Community
Participate
Working Groups
The compiler reports that field x of inner class B is never used locally, although it is in fact used by the enclosing class A. No warning is reported against field x of inner class C, but B and C are nearly identical except for the use of generics in B. public class A { private static class B<T> { private Object x; public B(T x) { this.x = x; } } private static class C { private Object x; public C(Object x) { this.x = x; } } public static void main(String[] args) throws Throwable { B<String> b = new B<String>("foo"); System.out.println(b.x); C c = new C("foo"); System.out.println(c.x); } }
Feels like a dup of bug 104167. Cannot reproduce any longer. Note this was fixed a long time ago, in 3.1.1 already. *** This bug has been marked as a duplicate of 104167 ***