mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Java: exclude anonymous, local, and private classes
This commit is contained in:
@@ -59,4 +59,32 @@ public class AnnotationTest {
|
||||
public void test() {
|
||||
}
|
||||
}
|
||||
|
||||
interface Test9 {
|
||||
}
|
||||
|
||||
public void f() {
|
||||
// COMPLIANT: anonymous classes are not considered as inner test
|
||||
// classes by JUnit and therefore don't need `@Nested`
|
||||
new Test9() {
|
||||
@Test
|
||||
public void test() {
|
||||
}
|
||||
};
|
||||
// COMPLIANT: local classes are not considered as inner test
|
||||
// classes by JUnit and therefore don't need `@Nested`
|
||||
class Test10 {
|
||||
@Test
|
||||
void test() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// COMPLIANT: private classes are not considered as inner test
|
||||
// classes by JUnit and therefore don't need `@Nested`
|
||||
private class Test11 {
|
||||
@Test
|
||||
public void test() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user