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 243789 - Add import fix should *not* do organize imports
Summary: Add import fix should *not* do organize imports
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-12 19:46 UTC by Jan Lahoda
Modified: 2014-05-25 01:30 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 Jan Lahoda 2014-04-12 19:46:40 UTC
Recently, I have heard complaints about Add Import fix doing organize imports instead of simply adding the single import. This causes bigger changes than necessary if the import section does not match the formatting settings (which happens in practice). I personally don't like the new behavior either - I would suggest to at least introduce an option that would control the behavior (my personal preference would be to keep the pre-8 behavior as the default).

Introduced through bug #212585:
http://hg.netbeans.org/jet-main/rev/38006f0d3937
Comment 1 zoladkow 2014-05-20 09:28:09 UTC
I second this issue. Since moving to NB8 I'm struggling with editor reorganizing/breaking separation of imports in Java classes. 

Or at least it does not respect the import layout I have set up in Editor > Formatting. 

I have a predefined grouping of imports, with group separation, which vanishes each time a new class has to be imported. Vanishes - meaning that separating lines are removed


Previously I was actually using Organize Imports plugin to fix my grouping, but currently it is either not working, or has the same effect - ie. the groups are not separated if the imports are already correctly ordered...
Comment 2 Svata Dedic 2014-05-23 14:48:42 UTC
fixed in jet-main#18a58dc2fdf4
Comment 3 Quality Engineering 2014-05-25 01:30:49 UTC
Integrated into 'main-silver', will be available in build *201405250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/18a58dc2fdf4
User: Svata Dedic <sdedic@netbeans.org>
Log: #243789: organize imports after import class disabled by default. Option checkbox provided in Error fixes category