MCPcopy Create free account
hub / github.com/spotbugs/spotbugs / AbstractClass

Class AbstractClass

spotbugsTestCases/src/java/singletons/AbstractClass.java:8–46  ·  view source on GitHub ↗

See #2934

Source from the content-addressed store, hash-verified

6 * See <a href="https://github.com/spotbugs/spotbugs/issues/2934">#2934</a>
7 */
8public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…