Community
Participate
Working Groups
Build 20020528 1. Make a compilation unit named Foo.java 2. In Foo.java, define a class named Foo1: class Foo1 { public static int X= 1; } 3. In another compilation unit in the same package, make a reference to Foo1: public class Hello { public static void main(String[] args) { System.out.println(Foo1.X); } } A quickfix error is shown which states that Foo1 cannot be resolved. However, this code *does* compile.
can't reproduce. If you type some spaces, does the quickfix error disapear?
*** Bug 17104 has been marked as a duplicate of this bug. ***
Need testing during TP#2
Foo1 is a secondary type in the Foo.java compilation unit. That't why quickfix can not resolve this type. The file Hello.java can be compiled because Foo.java is already compiled but if Foo.java is not compiled before then the compiler produce the same error as quickfix. The current behavior is correct. Closing.
The error remains even after the compiler has run and successfully compiled the classes. Close the report if you won't fix the bug, but the behavior is NOT correct.
The behavior is acceptable given that secondary types are not actively found (would need parsing everything eagerly). The build state isn't used by the tooling which is only based on sources (you can decouple it from building). As said earlier, an incremental compilation might show the same limitation, if the secondary type hasn't been fed to the compiler upfront (javac behaves in the same way).
Won't fix