Skip to content

Commit b73c74a

Browse files
committed
Code cleanup from code review
1 parent 1c98642 commit b73c74a

File tree

7 files changed

+18
-7
lines changed

7 files changed

+18
-7
lines changed

java/ql/lib/semmle/code/java/environment/SystemProperty.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* Provides classes and predicates for working with java system properties.
3+
*/
4+
15
import java
26
private import semmle.code.java.dataflow.DataFlow
37
private import semmle.code.java.frameworks.Properties

java/ql/lib/semmle/code/java/frameworks/Properties.qll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
import semmle.code.java.Type
33
private import semmle.code.java.dataflow.FlowSteps
44

5+
/**
6+
* The `java.util.Properties` class.
7+
*/
58
class TypeProperty extends Class {
69
TypeProperty() { hasQualifiedName("java.util", "Properties") }
710
}
811

12+
/** The `getProperty` method of the class `java.util.Properties`. */
913
class PropertiesGetPropertyMethod extends ValuePreservingMethod {
1014
PropertiesGetPropertyMethod() {
1115
getDeclaringType() instanceof TypeProperty and
@@ -15,20 +19,25 @@ class PropertiesGetPropertyMethod extends ValuePreservingMethod {
1519
override predicate returnsValue(int arg) { arg = 1 }
1620
}
1721

22+
/** The `get` method of the class `java.util.Properties`. */
1823
class PropertiesGetMethod extends Method {
1924
PropertiesGetMethod() {
2025
getDeclaringType() instanceof TypeProperty and
2126
hasName("get")
2227
}
2328
}
2429

30+
/** The `setProperty` method of the class `java.util.Properties`. */
2531
class PropertiesSetPropertyMethod extends Method {
2632
PropertiesSetPropertyMethod() {
2733
getDeclaringType() instanceof TypeProperty and
2834
hasName("setProperty")
2935
}
3036
}
3137

38+
/**
39+
* The methods of the class `java.util.Properties` that write the contents to an output.
40+
*/
3241
class PropertiesStoreMethod extends Method {
3342
PropertiesStoreMethod() {
3443
getDeclaringType() instanceof TypeProperty and

java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ private class TempDirSystemGetPropertyDirectlyToMkdirConfig extends TaintTrackin
177177
}
178178

179179
override predicate isSource(DataFlow::Node node) {
180-
exists(
181-
ExprSystemGetPropertyTempDirTainted propertyGetExpr, DataFlow::Node callSite
182-
|
180+
exists(ExprSystemGetPropertyTempDirTainted propertyGetExpr, DataFlow::Node callSite |
183181
DataFlow::localFlow(DataFlow::exprNode(propertyGetExpr), callSite)
184182
|
185183
isFileConstructorArgument(callSite.asExpr(), node.asExpr(), 1)

java/ql/test/library-tests/os/specific-unix-variant-test.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import default
22
import semmle.code.java.os.OSCheck
33

44
from IsSpecificUnixVariant isAnyUnix
5-
select isAnyUnix
5+
select isAnyUnix

java/ql/test/library-tests/os/specific-windows-variant-test.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import default
22
import semmle.code.java.os.OSCheck
33

44
from IsSpecificWindowsVariant isAnyWindows
5-
select isAnyWindows
5+
select isAnyWindows

java/ql/test/library-tests/os/unix-test.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import default
22
import semmle.code.java.os.OSCheck
33

44
from IsUnixGuard isUnix
5-
select isUnix
5+
select isUnix

java/ql/test/library-tests/os/windows-test.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import default
22
import semmle.code.java.os.OSCheck
33

44
from IsWindowsGuard isWindows
5-
select isWindows
5+
select isWindows

0 commit comments

Comments
 (0)