File tree Expand file tree Collapse file tree 2 files changed +51
-1
lines changed
java/ql/test/query-tests/EmptyMethod Expand file tree Collapse file tree 2 files changed +51
-1
lines changed Original file line number Diff line number Diff line change
1
+ import org .aspectj .lang .annotation .Pointcut ;
2
+
3
+ public class Class1 {
4
+
5
+ // COMPLIANT
6
+ public void f () {
7
+ int i = 0 ;
8
+ }
9
+
10
+ // COMPLIANT
11
+ public void f1 () {
12
+ // intentionally empty
13
+ }
14
+
15
+ // NON_COMPLIANT
16
+ public void f2 () { } // $ Alert
17
+
18
+ // COMPLIANT - exception
19
+ @ Pointcut ()
20
+ public void f4 () {
21
+ }
22
+
23
+ public abstract class TestInner {
24
+
25
+ public abstract void f (); // COMPLIANT - intentionally empty
26
+
27
+ }
28
+
29
+ public class Derived extends TestInner {
30
+
31
+ // COMPLIANT: with annotation
32
+ @ Override
33
+ public void f () {
34
+ }
35
+
36
+ // COMPLIANT: native
37
+ public native int nativeMethod ();
38
+ }
39
+
40
+ public interface TestInterface {
41
+
42
+ // NON_COMPLIANT
43
+ default void method () { } // $ Alert
44
+ }
45
+
46
+ }
Original file line number Diff line number Diff line change 1
- | Test.java:16:15:16:16 | f2 | Empty method found. |
1
+ #select
2
+ | Class1.java:16:15:16:16 | f2 | Empty method found. |
3
+ | Class1.java:43:18:43:23 | method | Empty method found. |
2
4
| Test.java:43:18:43:23 | method | Empty method found. |
5
+ testFailures
6
+ | Test.java:16:24:16:33 | // $ Alert | Missing result: Alert |
You can’t perform that action at this time.
0 commit comments