mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Merge pull request #6366 from smowton/smowton/fiix/junit-nested-classes
Prevent class-could-be-static alerts regarding JUnit Nested tests
This commit is contained in:
@@ -127,7 +127,9 @@ predicate potentiallyStatic(InnerClass c) {
|
||||
forall(InnerClass superOfNested | superOfNested = nested.getASourceSupertype+() |
|
||||
potentiallyStatic(superOfNested)
|
||||
)
|
||||
)
|
||||
) and
|
||||
// JUnit Nested test classes are required to be non-static.
|
||||
not c.hasAnnotation("org.junit.jupiter.api", "Nested")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user