This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The ElementOverlay is currently stored in the javac's context when running modification task for the first time, but not when subsequent modification tasks are running over the same javac. As ImportAnalysis2 uses the value from the javac's context, while WorkingCopy is registering classes into an ElementOverlay created for that particular modification task. This leads to incorrect import resolution as the import analysis is not seeing the classes newly created in the current modification task.
Created attachment 115798 [details] Result of some debugging.
http://hg.netbeans.org/jet-main/rev/b1f8e0d263cc
Integrated into 'main-golden', will be available in build *201204030400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b1f8e0d263cc User: Jan Lahoda <jlahoda@netbeans.org> Log: #208490: must consistently use the current ElementOverlay.