See #2934
| 6 | * See <a href="https://github.com/spotbugs/spotbugs/issues/2934">#2934</a> |
| 7 | */ |
| 8 | public abstract class AbstractClass implements Serializable { |
| 9 | public static class Nested extends AbstractClass { |
| 10 | private static final long serialVersionUID = 1L; |
| 11 | |
| 12 | private final String appTag; |
| 13 | |
| 14 | Nested(final String appTag) { |
| 15 | this.appTag = appTag; |
| 16 | } |
| 17 | |
| 18 | @Override |
| 19 | String abstractMethod() { |
| 20 | return appTag; |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | private static final AbstractClass NESTED = new Nested(null); |
| 25 | private static final long serialVersionUID = 1L; |
| 26 | |
| 27 | public static AbstractClass nested() { |
| 28 | return NESTED; |
| 29 | } |
| 30 | |
| 31 | abstract String abstractMethod(); |
| 32 | |
| 33 | @Override |
| 34 | public final int hashCode() { |
| 35 | return Objects.hash(abstractMethod()); |
| 36 | } |
| 37 | |
| 38 | @Override |
| 39 | public final boolean equals(final Object obj) { |
| 40 | if (this == obj || obj instanceof AbstractClass) { |
| 41 | AbstractClass other = (AbstractClass) obj; |
| 42 | return Objects.equals(abstractMethod(), other.abstractMethod()); |
| 43 | } |
| 44 | return false; |
| 45 | } |
| 46 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…