| 1 | class InheritedField { |
| 2 | public static void main(String[] args) { |
| 3 | corner1(); |
| 4 | corner2(); |
| 5 | } |
| 6 | |
| 7 | static void corner1() { |
| 8 | B b = new B(); |
| 9 | b.setSuperF(22); |
| 10 | int x = b.f; |
| 11 | int y = foo(b); |
| 12 | } |
| 13 | |
| 14 | static int foo(A a) { |
| 15 | return a.f; |
| 16 | } |
| 17 | |
| 18 | static void corner2() { |
| 19 | A a = new A(); |
| 20 | a.f = 22; |
| 21 | B b = new B(); |
| 22 | b.f = 33; |
| 23 | bar(a); |
| 24 | int x = b.f; |
| 25 | int y = bar(b); |
| 26 | } |
| 27 | |
| 28 | static int bar(A a) { |
| 29 | return a.f; |
| 30 | } |
| 31 | |
| 32 | |
| 33 | } |
| 34 | |
| 35 | class A { |
| 36 | int f; |
nothing calls this directly
no outgoing calls
no test coverage detected