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.

Bug 216980 - Fix Imports fails on Groovy
Summary: Fix Imports fails on Groovy
Status: RESOLVED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: PC Mac OS X
: P2 normal (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-16 16:23 UTC by driscoll
Modified: 2012-08-21 15:08 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description driscoll 2012-08-16 16:23:39 UTC
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.
Comment 1 driscoll 2012-08-16 16:24:36 UTC
I should mention - if the Fix Imports requires a prompt, it will also prompt every time.
Comment 2 Martin Janicek 2012-08-20 08:14:57 UTC
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.
Comment 3 Martin Janicek 2012-08-20 09:03:49 UTC
Fixed in: web-main #f290d1c7883a
Comment 4 Quality Engineering 2012-08-21 15:08:01 UTC
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