Skip to content

Commit 25d251c

Browse files
author
Benjamin Muskalla
committed
Exclude main methods from models
1 parent 7e3f3c6 commit 25d251c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

java/ql/src/utils/model-generator/ModelGeneratorUtils.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ private string isExtensible(RefType ref) {
2929

3030
predicate isRelevantForModels(Callable api) {
3131
not isInTestFile(api.getCompilationUnit().getFile()) and
32-
not isJdkInternal(api.getCompilationUnit())
32+
not isJdkInternal(api.getCompilationUnit()) and
33+
not api instanceof MainMethod
3334
}
3435

3536
private predicate isInTestFile(File file) {

java/ql/test/utils/model-generator/p/Sinks.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ public String readUrl(final URL url, Charset encoding) throws IOException {
2121
}
2222
}
2323

24+
public static void main(String[] args) throws IOException {
25+
String foo = new Sinks().readUrl(new URL(args[0]), Charset.defaultCharset());
26+
}
27+
2428
}

0 commit comments

Comments
 (0)