JDK-6431987 : javac failed to compile the source code
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-05-31
  • Updated: 2010-05-11
  • Resolved: 2006-10-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 Other
6u1Resolved OpenJDK6Resolved
Related Reports
Duplicate :  
Relates :  
Description
Trying to compile the attached a/A.java and b/B.java causes the following error:

b/B.java:8: cannot find symbol
symbol  : class A
location: class b.B
  public static class Nested extends A {
                                     ^
1 error

See the attached test.zip for the concrete test case.

I suspect the tricky self-importing is causing this issue. I'm not too confident if such import is allowed or not, but if it is, this is a bug. If it's not, then I hope the error message will be improved to point that out.

Comments
EVALUATION This is a regression in the compiler. This program compiles with problems in releases 1.3.1_18 and 1.4.2_11.
31-05-2006

WORK AROUND Change the order of imports: import a.A; import b.B.Nested; import b.B.Nested.More;
31-05-2006