mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Java: Add initial version of empty method query
This commit is contained in:
29
java/ql/test/query-tests/EmptyMethod/Test.java
Normal file
29
java/ql/test/query-tests/EmptyMethod/Test.java
Normal file
@@ -0,0 +1,29 @@
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
|
||||
public class Test {
|
||||
|
||||
// COMPLIANT
|
||||
public void f() {
|
||||
int i = 0;
|
||||
}
|
||||
|
||||
// COMPLIANT
|
||||
public void f1() {
|
||||
// intentionally empty
|
||||
}
|
||||
|
||||
// NON_COMPLIANT
|
||||
public void f2() {}
|
||||
|
||||
// COMPLIANT - exception
|
||||
@Pointcut()
|
||||
public void f4() {}
|
||||
|
||||
public abstract class TestInner {
|
||||
|
||||
public abstract void f(); // COMPLIANT - intentionally empty
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user