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 210940 - Disable star import in default install
Summary: Disable star import in default install
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.2
Hardware: PC All
: P3 normal with 2 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-10 12:30 UTC by emi
Modified: 2012-04-12 09:59 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 emi 2012-04-10 12:30:45 UTC
"Fix All Imports" on multiple java.util classes produces a single

 import java.util.*;

while in another class where I already have the imports I get a hint that replaces all those with a star import.

To me, star import is a bad practice and I'm quite surprised the IDE is pushing it so hard nowadays.

So, I'm suggesting that we disable the star import and let people that want it to enable it via Editor | Formatting | Java / Category: Imports.

(A 2nd note here: the settings for toggling this feature are downright impossible to find!)

Not only that but in Options| Editor | Hints | Imports there is a Star import hint that I would expect to get rid of the star import and bring back the individual imports but it has no associated refactoring (this being bug #118994 ).
Comment 1 Dusan Balek 2012-04-10 14:52:51 UTC
Perhaps you are right - changing default.

Fixed in jet-main.
http://hg.netbeans.org/jet-main/rev/147be0b0035b
Comment 2 Petr Somol 2012-04-10 15:11:12 UTC
IMHO there remains the problem of discoverability of this functionality, should any users actually prefer to use it (although I agree with disabling star imports by default). 

Would it be possible, e.g., to add to the pop-up window a "Customize Organize imports..." option (just like Set Project Configuration drop-down list in main toolbar contains "Customize..."), which would open the Options dialog, open the Editor category, Formatting tab and pre-select Language: Java and Category: Imports ?
Comment 3 Quality Engineering 2012-04-12 09:59:23 UTC
Integrated into 'main-golden', will be available in build *201204120400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/147be0b0035b
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #210940: Disable star import in default install - fixed.