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 246010 - Organize Imports hint expands all wildcard static imports
Summary: Organize Imports hint expands all wildcard static imports
Status: RESOLVED DUPLICATE of bug 238208
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 8.0
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-25 14:19 UTC by kalaider
Modified: 2014-07-25 19:10 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 kalaider 2014-07-25 14:19:06 UTC
The "Fix Imports" hint makes its black buisiness.

All the wildcard imports are turned now to the non-wildcard ones. So, if I statically imported all the constants from the class A and use most of them, NetBeans replaces the wildcard import with a large number of direct imports (it is a real trouble when the feature works on save: I must add (or edit existing) import for each constant from the class A that I want to use in my code!).

In the previous version was no wildcard expansion. Please, turn off the feature or at least make it configurable...

========
Examples
========

Before "Organize Imports":

import A.*;

static {
    print(CONSTANT_1);
    print(CONSTANT_2);
    // ...
    print(CONSTANT_N);
}

After the "Organize Imports":

import A.CONSTANT_1;
import A.CONSTANT_2;
// ...
import A.CONSTANT_N;

static {
    print(CONSTANT_1);
    print(CONSTANT_2);
    // ...
    print(CONSTANT_N);
}

And when I want to use CONSTANT_N_PLUS_ONE, I should manually add it to the list of imports...
Comment 1 kalaider 2014-07-25 14:20:41 UTC
Sorry, it must be [import static A.*]. Oh, my carelessness!
Comment 2 kalaider 2014-07-25 15:25:59 UTC
Sorry again, but I found a solution: I missed the Formatting subtab in Editor tab. The issue may be closed...
Comment 3 Jiri Prox 2014-07-25 19:10:05 UTC

*** This bug has been marked as a duplicate of bug 238208 ***