Debian Codegraph @

checker/tests/nullness/generics/InferMethod.java

raw
1 // From issue #216:
2 // https://github.com/typetools/checker-framework/issues/216
3
4 public class InferMethod {
5 public abstract static class Generic<T> {
6 public class Nested {
7 public void nestedMethod(T item) {}
8 }
9
10 public static class NestedStatic<TInner> {
11 public void nestedMethod2(TInner item) {}
12 }
13
14 public abstract void method();
15
16 public abstract void method2();
17
18 public void method3(T item) {}
19 }
20
21 public static class Concrete extends Generic<String> {
22
23 @Override
24 public void method() {
25 Nested o = new Nested();
26 o.nestedMethod("test");
27 }
28
29 @Override
30 public void method2() {
31 NestedStatic<String> o = new NestedStatic<>();
32 o.nestedMethod2("test");
33
34 this.method3("test");
35 }
36 }
37 }