Apply suggestions from code review

Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
This commit is contained in:
Jonathan Leitschuh
2021-01-04 10:13:52 -05:00
committed by GitHub
parent 54950c2f42
commit 028e4756bb
2 changed files with 4 additions and 9 deletions

View File

@@ -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

View File

@@ -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")