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.
QualIdents are sometimes replaced by simple names, but the corresponding imports are not added. This makes the code uncompilable. Steps to reproduce: 1. Create new JFrame. 2. Add JLabel into the frame. 3. Select the root node in the Inspector. 4. Un-check Generate Full Classnames in the Properties window. 5. Switch to Source view => GroupLayout, WindowConstants and JLabel were replaced by simple names, but only one import (for JLabel) was added The corresponding code (in form/src/org/netbeans/modules/form/FQNImporter.java) uses several invocations of WorkingCopy.rewrite() in one task. It seems that only imports from the last rewrite are added e.g. it works well when just one rewrite is invoked.
I just realized that the provided steps do not lead to the problem every time. There seem to be some race conditions. The general advice is to reproduce this issue is: 1. Un-check Generate Full Classnames for some form (as described above). 2. Add some components that are not on the form already. 3. Switch to Source and check whether there are some errors. I am not able to provide a 100% reliable test-case, but these instructions lead to the problem pretty quickly.
Should be OK now: http://hg.netbeans.org/main?cmd=changeset;node=6c4e99f48e9f
Integrated into 'main-golden', available in NB_Trunk_Production #324 build Changeset: http://hg.netbeans.org/main/rev/6c4e99f48e9f User: Jan Lahoda <jlahoda@netbeans.org> Log: #138100: imports clauses might not be added correctly for several independent QualIdents.
To jiriprox: Just curious, why do you think that this issue is important for NB 6.1 patch? The use-case described in the issue is not possible in NB 6.1 - there's no Generate Full Classnames in NB 6.1. While I understand that the fix provided by jlahoda can help in other cases as well it would be IHMO a good idea to provide such a use-case as a justification for inclusion in the patch.
I see, thanks. I didn't noticed it's 6.5 specific. As far as I know there are no other similar problems reported -> removing patch candidate status