File tree Expand file tree Collapse file tree 4 files changed +3
-5
lines changed
test/query-tests/EmptyMethod Expand file tree Collapse file tree 4 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public class Test {
28
28
29
29
## Implementation Notes
30
30
31
- The rule excludes reporting methods that are annotated or marked as ` default ` .
31
+ The rule excludes reporting methods that are annotated.
32
32
33
33
## References
34
34
- [ java.util.Collections.add] ( https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/util/Collection.html#add(E) )
Original file line number Diff line number Diff line change 86
86
not exists ( m .getDoc ( ) .getJavadoc ( ) ) and
87
87
//annotated methods are considered compliant
88
88
not exists ( m .getAnAnnotation ( ) ) and
89
- //default methods are not abstract, but are considered compliant
90
- not m .isDefault ( ) and
91
89
//native methods have no body
92
90
not m .isNative ( )
93
91
select m , "This empty method should be completed."
Original file line number Diff line number Diff line change 1
1
| Test.java:13:15:13:16 | f2 | This empty method should be completed. |
2
+ | Test.java:35:18:35:23 | method | This empty method should be completed. |
Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ public void f() {
32
32
33
33
public interface TestInterface {
34
34
35
- default void method () {
36
- }
35
+ default void method () { } // $ Alert
37
36
}
38
37
39
38
}
You can’t perform that action at this time.
0 commit comments