You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An empty method may indicate that an implementation was intended to be provided but was accidentally omitted. When using the method, it will not be clear that it does not provide an implementation and with dynamic dispatch, resolving to a blank method may result in unexpected program behavior.
4
+
5
+
## Recommendation
6
+
7
+
If a method is intended to be left empty, do one of the following to indicate that it is intentionally empty:
8
+
1. Mark it abstract in an abstract class
9
+
2. Place it in an interface (then it can be implicitly abstract)
10
+
3. Place a comment in that method that lets others know that the implementation was intentionally omitted
11
+
4. Add `UnsupportedOperationException` to the method (as in `java.util.Collection.add`).
0 commit comments