Skip to content

Commit 121fd08

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: exclude internal packages in general from models
1 parent 06b1cd9 commit 121fd08

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/ModelExclusions.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,16 @@ private predicate isJdkInternal(CompilationUnit cu) {
5353
cu.getPackage().getName() = ""
5454
}
5555

56+
/** Holds if the given compilation unit's package is internal. */
57+
private predicate isInternal(CompilationUnit cu) {
58+
isJdkInternal(cu) or
59+
cu.getPackage().getName().matches("%internal%")
60+
}
61+
5662
/** Holds if the given callable is not worth modeling. */
5763
predicate isUninterestingForModels(Callable c) {
5864
isInTestFile(c.getCompilationUnit().getFile()) or
59-
isJdkInternal(c.getCompilationUnit()) or
65+
isInternal(c.getCompilationUnit()) or
6066
c instanceof MainMethod or
6167
c instanceof StaticInitializer or
6268
exists(FunctionalExpr funcExpr | c = funcExpr.asMethod()) or

0 commit comments

Comments
 (0)