Skip to content

Commit 614bee9

Browse files
committed
Use inline test expectations
1 parent a8063e1 commit 614bee9

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| Test.java:16:17:16:18 | f2 | Empty method found. |
1+
| Test.java:13:15:13:16 | f2 | Empty method found. |
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Language Abuse/EmptyMethod.ql
1+
query: Language Abuse/EmptyMethod.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql

java/ql/test/query-tests/EmptyMethod/Test.java

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,23 @@
22

33
public class Test {
44

5-
// COMPLIANT
6-
public void f() {
7-
int i = 0;
8-
}
5+
public void f() {
6+
int i = 0;
7+
}
98

10-
// COMPLIANT
11-
public void f1() {
12-
// intentionally empty
13-
}
9+
public void f1() {
10+
// intentionally empty
11+
}
1412

15-
// NON_COMPLIANT
16-
public void f2() {}
13+
public void f2() { } // $ Alert
1714

18-
// COMPLIANT - exception
19-
@Pointcut()
20-
public void f4() {}
15+
@Pointcut()
16+
public void f4() {
17+
}
2118

22-
public abstract class TestInner {
19+
public abstract class TestInner {
2320

24-
public abstract void f(); // COMPLIANT - intentionally empty
25-
}
21+
public abstract void f();
22+
}
2623

2724
}
28-
29-

0 commit comments

Comments
 (0)