mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
Use inline test expectations
This commit is contained in:
@@ -1 +1 @@
|
||||
| Test.java:16:17:16:18 | f2 | Empty method found. |
|
||||
| Test.java:13:15:13:16 | f2 | Empty method found. |
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
Language Abuse/EmptyMethod.ql
|
||||
query: Language Abuse/EmptyMethod.ql
|
||||
postprocess: utils/test/InlineExpectationsTestQuery.ql
|
||||
|
||||
@@ -2,28 +2,23 @@ import org.aspectj.lang.annotation.Pointcut;
|
||||
|
||||
public class Test {
|
||||
|
||||
// COMPLIANT
|
||||
public void f() {
|
||||
int i = 0;
|
||||
}
|
||||
public void f() {
|
||||
int i = 0;
|
||||
}
|
||||
|
||||
// COMPLIANT
|
||||
public void f1() {
|
||||
// intentionally empty
|
||||
}
|
||||
public void f1() {
|
||||
// intentionally empty
|
||||
}
|
||||
|
||||
// NON_COMPLIANT
|
||||
public void f2() {}
|
||||
public void f2() { } // $ Alert
|
||||
|
||||
// COMPLIANT - exception
|
||||
@Pointcut()
|
||||
public void f4() {}
|
||||
@Pointcut()
|
||||
public void f4() {
|
||||
}
|
||||
|
||||
public abstract class TestInner {
|
||||
public abstract class TestInner {
|
||||
|
||||
public abstract void f(); // COMPLIANT - intentionally empty
|
||||
}
|
||||
public abstract void f();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user