Skip to content

Commit 0510b0c

Browse files
committed
Java: restrict test to source methods
Otherwise it finds standard library methods that depend on stdlib internals as to what happens to get extracted. In particular the extractor bump to JDK21 led to MethodHandles being in scope and a new method being found; seems better to avoid considering the standard library at all.
1 parent d56a9f0 commit 0510b0c

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

java/ql/test/library-tests/sensitive-actions/test.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,3 @@ sensitiveDataMethod
6767
| Test.java:37:18:37:31 | aaCryptAccntaa |
6868
| Test.java:39:18:39:33 | aaCryptTrustedaa |
6969
| Test.java:41:18:41:40 | aaCryptRefreshaaTokenaa |
70-
| file:///modules/java.base/java/lang/invoke/MemberName.class:0:0:0:0 | isTrustedFinalField |
71-
| file:///modules/java.base/java/lang/reflect/Field.class:0:0:0:0 | isTrustedFinal |

java/ql/test/library-tests/sensitive-actions/test.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ query predicate sensitiveVariable(Variable v) {
99
v.getName().regexpMatch(getCommonSensitiveInfoRegex())
1010
}
1111

12-
query predicate sensitiveDataMethod(SensitiveDataMethod m) { any() }
12+
query predicate sensitiveDataMethod(SensitiveDataMethod m) { m.fromSource() }

0 commit comments

Comments
 (0)