mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
54950c2f42
commit
028e4756bb
@@ -212,14 +212,14 @@ class MethodSystemGetProperty extends Method {
|
||||
}
|
||||
|
||||
/**
|
||||
* Any method access to a method named `getProperty` on class `java.lang.System`.
|
||||
* An access to a method named `getProperty` on class `java.lang.System`.
|
||||
*/
|
||||
class MethodAccessSystemGetProperty extends MethodAccess {
|
||||
MethodAccessSystemGetProperty() { getMethod() instanceof MethodSystemGetProperty }
|
||||
|
||||
/**
|
||||
* Holds true if this is a compile-time constant call for the specified `propertyName`.
|
||||
* Eg. `System.getProperty("user.dir")`.
|
||||
* Holds if this call has a compile-time constant first argument with the value `propertyName`.
|
||||
* For example: `System.getProperty("user.dir")`.
|
||||
*/
|
||||
predicate hasCompileTimeConstantGetPropertyName(string propertyName) {
|
||||
this.getArgument(0).(CompileTimeConstantExpr).getStringValue() = propertyName
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
/**
|
||||
* @name SystemCall
|
||||
* @description Test the definition of System Get Property
|
||||
*/
|
||||
|
||||
import default
|
||||
import java
|
||||
|
||||
from MethodAccessSystemGetProperty ma
|
||||
where ma.hasCompileTimeConstantGetPropertyName("user.dir")
|
||||
|
||||
Reference in New Issue
Block a user