Bug 35658 - Cannot resolve Inner Class reference
Summary: Cannot resolve Inner Class reference
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: 2.1 RC4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-25 13:27 EST by alan dodridge CLA
Modified: 2003-03-26 04:27 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 alan dodridge CLA 2003-03-25 13:27:39 EST
1 - Public class with inner class which contains a static int

package com.kainos.solas.test;
public class TestParentClass
{
    public TestParentClass(){}

    public class TestInnerClass
    {
        public final static int i = 0;
    }
    
}

2 - Try and reference the int from another class

package com.kainos.solas.test;
public class CallInnerClass
{

    TestParentClass tpc = new TestParentClass();
    
    int a = tpc.TestInnerClass.i; 

}

** ECLIPSE SAYS - tpc.TestInnerClass cannot be resolved or is not a field
Comment 1 Philipe Mulet CLA 2003-03-26 04:27:24 EST
Such a reference is forbidden as per JLS 6.5.6.
    int a = tpc.TestInnerClass.i; 
should be written
    int a = TestParentClass.TestInnerClass.i; 

Some 1.3 compilers were too permissive. Most 1.4 compilers are doing the proper 
thing. Eclipse is enforcing the spec here.