Bug 83161

Summary: Can't access public field from private subclass
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.0   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Martin Aeschlimann CLA 2005-01-19 04:03:50 EST
Since I20050118 this code does not compile anymore. The access to 'publicField'
is marked as 'not visible'

public class A {
	private static class PrivateInner {
		public int publicField;
	}	
	public static class PublicInner extends PrivateInner {	
	}
}
class B {
	void foo(Object o) {
		A.PublicInner x;

		int i= ((A.PublicInner)o).publicField;
		int j= x.publicField;
	}
}

Also note the strange error range marked on the assignment to 'i'
Comment 1 Olivier Thomann CLA 2005-01-19 16:08:28 EST
This is fixed in HEAD where we report:
----------
1. ERROR in c:\tests_sources\A.java
 (at line 13)
	int j= x.publicField;
	       ^^^^^^^^^^^^^
The local variable x may not have been initialized
----------
1 problem
Comment 2 Kent Johnson CLA 2005-01-19 16:12:56 EST
Was fixed & released yesterday... just after the integration build :(.
Comment 3 David Audel CLA 2005-02-16 06:11:43 EST
Verified in I20050215-2300