Bug 126105

Summary: false "never used locally" warning from generic inner class
Product: [Eclipse Project] JDT Reporter: Art Dyer <art.dyer>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1.1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Art Dyer CLA 2006-02-01 17:34:23 EST
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);
      }
    }
Comment 1 Philipe Mulet CLA 2006-02-13 17:33:05 EST
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 ***