JDK-7185290 : javac fails to compile inner class when secondary inner class is involved
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6u31
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2012-07-19
  • Updated: 2012-09-06
  • Resolved: 2012-07-20
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
jdk1.6.0_33, jdk1.5.0_22

ADDITIONAL OS VERSION INFORMATION :
Windows XP

A DESCRIPTION OF THE PROBLEM :
see bug id 6707323 :

Javac fails to compile inner class, when a secondary inner class (inner class of the inner class)
is imported first. It appears that importing a secondary inner class hides symbols in inner class.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Javac fails to compile inner class, when a secondary inner class (inner class of the inner class)
is imported first. It appears that importing a secondary inner class hides symbols in inner class.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
BUILD SUCCESSFUL
ACTUAL -
BUILD FAILED

ERROR MESSAGES/STACK TRACES THAT OCCUR :
pack1\Test.java:8: cannot find symbol
symbol  : class Test2
location: class pack1.Test
	public class Test3 extends Test2 {
	                           ^
1 error


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
pack2.Test2 class :
--------------------------

package pack2;

public class Test2
{

}

pack1.Test class :
-------------------------
package pack1;

import pack1.Test.Test3.Test4;
import pack2.Test2;

public class Test extends Test2 {
	
	public class Test3 extends Test2 {
		public class Test4 {
			
		}
	}
	
	public void test() {
		Test4 test4;
	}
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
change sequence of import statements