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 92176 - Imports satements should be optimized and fixed automatically.
Summary: Imports satements should be optimized and fixed automatically.
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker with 4 votes (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks: 47599
  Show dependency tree
 
Reported: 2007-01-10 05:36 UTC by pcmreddy
Modified: 2015-10-02 14:26 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pcmreddy 2007-01-10 05:36:01 UTC
Usecase : Conside the following case.
If users code has the folloing.
   "import java.io.*;"

Even if user applies "Fix import" should remove the above mentioned import and 
add optimized classes only.

Like the following:
   "import java.io.IOException;"
   "import java.io.PrintWriter;"


The same thing happend in the foilowing case too.
   "import java.io.IOException;"
   "import java.io.*;"
Comment 1 Vitezslav Stejskal 2007-01-10 09:48:05 UTC
Ok, what does it do now? If it's just inefficient import statements then the
priority is definitely not P2. Does the source compile? Can you keep working
even with the issue? Anyway, passing to java.
Comment 2 pcmreddy 2007-01-10 10:01:33 UTC
There is no problem in compilation.

If there is any import with wild char. 
Fix Import action does not add any individual classes.

As a work around:
User can remove such import line and run Fix Imports again.
IDE should have take care of optimized imports automatically
Comment 3 Svata Dedic 2015-10-02 14:26:17 UTC
Optimize and order imports are now optional actions during file save. Closing.