Bug 126105 - false "never used locally" warning from generic inner class
Summary: false "never used locally" warning from generic inner class
Status: RESOLVED DUPLICATE of bug 104167
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-01 17:34 EST by Art Dyer CLA
Modified: 2006-02-13 17:33 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***