File tree Expand file tree Collapse file tree 3 files changed +10
-47
lines changed
java/ql/test/query-tests/EmptyMethod Expand file tree Collapse file tree 3 files changed +10
-47
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ public void f2() { } // $ Alert
2020 public void f4 () {
2121 }
2222
23+ /**
24+ * COMPLIANT - empty method with javadoc
25+ */
26+ public void f5 () {
27+ }
28+
2329 public abstract class TestInner {
2430
2531 public abstract void f (); // COMPLIANT - intentionally empty
@@ -41,6 +47,8 @@ public interface TestInterface {
4147
4248 // NON_COMPLIANT
4349 default void method () { } // $ Alert
50+
51+ void method2 (); // COMPLIANT
4452 }
4553
4654}
Original file line number Diff line number Diff line change 1- #select
21| Class1.java:16:15:16:16 | f2 | Empty method found. |
3- | Class1.java:43:18:43:23 | method | Empty method found. |
4- | Test.java:43:18:43:23 | method | Empty method found. |
5- testFailures
6- | Test.java:16:24:16:33 | // $ Alert | Missing result: Alert |
2+ | Class1.java:49:18:49:23 | method | Empty method found. |
Original file line number Diff line number Diff line change 1- import org .aspectj .lang .annotation .Pointcut ;
2-
31public class Test {
4-
5- // COMPLIANT
2+ // COMPLIANT: allow empty method in test class
63 public void f () {
7- int i = 0 ;
84 }
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-
465}
You can’t perform that action at this time.
0 commit comments