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.
Fix Imports command fails to work correctly for Groovy files. To see the bug: Create a new Java Application. Create a new Groovy Class. Enter the line: Color color = new Color() Fix imports. It will correctly insert import java.awt.Color Now, add the line: Line line = new Line() Fix Imports. It will now incorrectly change the imports to be: import java.awt.Color import java.awt.Color import javax.sound.sampled.Line This effect is cumulative, and goes between files. It will last until you restart the IDE. This may seem on reading to be a minor bug. It is not. It effectively means that Fix Imports cannot be used in Groovy, which is a major impediment to development. This one bug made me switch development on my project to IntelliJ - which is too bad, since I'm trying to integrate JavaFX and Groovy, and Netbeans is much better for that purpose.
I should mention - if the Fix Imports requires a prompt, it will also prompt every time.
Thanks for the report and the detailed description! I'm easily able to reproduce the problem and truly can imagine how is that annoying. I'll try to fix as soon as possible.
Fixed in: web-main #f290d1c7883a
Integrated into 'main-golden', will be available in build *201208211308* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/f290d1c7883a User: Martin Janicek <mjanicek@netbeans.org> Log: #216980 - Fix Imports fails on Groovy