Skip to content

Commit 050ef40

Browse files
tamasvajkjcogs33
andcommitted
Improve query help
Co-authored-by: Jami <[email protected]>
1 parent 24f129c commit 050ef40

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

java/ql/src/Language Abuse/EmptyMethod.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ An empty method may indicate that an implementation was intended to be provided
44

55
## Recommendation
66

7-
If a method is intended to be left empty, do one of the following to indicate that it is intentionally empty: 1) mark it abstract in an abstract class, 2) place it in an interface (then it can be implicitly abstract), 3) place a comment in that method that lets others know that the implementation was intentionally omitted, or 4) throw an `UnsupportedOperationException` in the method (like is done in `java.util.Collections.add`).
7+
If a method is intended to be left empty, do one of the following to indicate that it is intentionally empty: 1) mark it abstract in an abstract class, 2) place it in an interface (then it can be implicitly abstract), 3) place a comment in that method that lets others know that the implementation was intentionally omitted, or 4) throw an `UnsupportedOperationException` in the method (like is done in `java.util.Collection.add`).
88

99
## Example
1010

@@ -31,5 +31,5 @@ public class Test {
3131
The rule excludes reporting methods that are annotated.
3232

3333
## References
34-
- Java SE Documentation: [java.util.Collections.add](https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/util/Collection.html#add(E))
35-
- Wikipedia: [Template pattern is a valid empty method use](https://en.wikipedia.org/wiki/Template_method_pattern)
34+
- Java SE Documentation: [java.util.Collection.add](https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/util/Collection.html#add(E))
35+
- Wikipedia: [Template method pattern](https://en.wikipedia.org/wiki/Template_method_pattern)

0 commit comments

Comments
 (0)