Apply suggestions from code review

Co-authored-by: Chris Smowton <smowton@github.com>
This commit is contained in:
Jonathan Leitschuh
2022-03-03 16:39:45 -05:00
committed by GitHub
parent fea50065f5
commit 103c770ce7
4 changed files with 6 additions and 6 deletions

View File

@@ -52,9 +52,9 @@ class StringPartialMatchMethod extends Method {
* The index of the parameter that is being matched against. * The index of the parameter that is being matched against.
*/ */
int getMatchParameterIndex() { int getMatchParameterIndex() {
if not this.hasName("regionMatches") if this.hasName("regionMatches")
then result = 0 then this.getParameterType(result) instanceof TypeString
else this.getParameterType(result) instanceof TypeString else result = 0
} }
} }

View File

@@ -2,7 +2,7 @@ import java
private import semmle.code.java.frameworks.apache.Lang private import semmle.code.java.frameworks.apache.Lang
/** /**
* Gets Expr that return the value of `propertyName` from `System.getProperty()`. * Gets an expression that retrieves the value of `propertyName` from `System.getProperty()`.
*/ */
Expr getSystemProperty(string propertyName) { Expr getSystemProperty(string propertyName) {
result = getSystemPropertyFromSystem(propertyName) or result = getSystemPropertyFromSystem(propertyName) or

View File

@@ -37,7 +37,7 @@ abstract class IsUnixGuard extends Guard { }
abstract class IsAnyUnixGuard extends Guard { } abstract class IsAnyUnixGuard extends Guard { }
/** /**
* Holds when the MethodAccess is a call to check the current OS using either the upper case `osUpperCase` or lower case `osLowerCase` string constants. * Holds when `ma` compares the current OS against the string constant `osString`.
*/ */
bindingset[osString] bindingset[osString]
private predicate isOsFromSystemProp(MethodAccess ma, string osString) { private predicate isOsFromSystemProp(MethodAccess ma, string osString) {

View File

@@ -104,7 +104,7 @@ private class FileCreateTempFileSink extends FileCreationSink {
} }
/** /**
* A guard that checks whether or not the the program is running on the Windows OS. * A guard that holds when the program is definitely running under some version of Windows.
*/ */
abstract private class WindowsOsBarrierGuard extends DataFlow::BarrierGuard { } abstract private class WindowsOsBarrierGuard extends DataFlow::BarrierGuard { }