Skip to content

Commit 2b1423d

Browse files
committed
Java: Exclude static initializers from model generation.
1 parent 37aa6b2 commit 2b1423d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

java/ql/src/utils/model-generator/internal/CaptureModelsSpecific.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ private predicate isJdkInternal(J::CompilationUnit cu) {
5555
private predicate isRelevantForModels(J::Callable api) {
5656
not isInTestFile(api.getCompilationUnit().getFile()) and
5757
not isJdkInternal(api.getCompilationUnit()) and
58-
not api instanceof J::MainMethod
58+
not api instanceof J::MainMethod and
59+
not api instanceof J::StaticInitializer
5960
}
6061

6162
/**

0 commit comments

Comments
 (0)