Use inline test expectations

This commit is contained in:
Tamas Vajk
2025-03-07 10:29:45 +01:00
parent a8063e1cd2
commit 614bee9e20
3 changed files with 16 additions and 20 deletions

View File

@@ -1 +1 @@
| Test.java:16:17:16:18 | f2 | Empty method found. |
| Test.java:13:15:13:16 | f2 | Empty method found. |

View File

@@ -1 +1,2 @@
Language Abuse/EmptyMethod.ql
query: Language Abuse/EmptyMethod.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -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();
}
}