Skip to content

Commit 53d92d5

Browse files
authored
Merge pull request github#14581 from jcogs33/jcogs33/add-internal-to-model-exclusions
Java: exclude internal packages globally from MaD models
2 parents 05385eb + 121fd08 commit 53d92d5

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)