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:
Anders Schack-Mulligen
2021-07-26 12:45:23 +02:00
committed by GitHub

View File

@@ -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")
}
/**