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.
[ BUILD # : 201109060600 ] [ JDK VERSION : 1.6.27 ] Hi, the "Import section does not correspond to the specified code style rules" hint is shown (see picture 1) but no clue about the problem or any solution is given by "Alt-Enter". Running "Organize Import" does not solve the problem. On the same file Netbeans 7.0.1 does not give any message. I think the cause is an empty line in between the import lines. When I manually remove the empty line, the message disappears. See picture 2 Unfortunately the hint is on the first line and not on the empty line. I suggest: * to have the hint message on the import which gives the problem and not on the first one. * to have "Remove all imports and run Organize Import" as "ALT+Enter" option Thanks
Created attachment 110533 [details] First screen shot with the hint message
Created attachment 110534 [details] Second screensot after removing empty line
Yes, you're right the problem is empty line, which does not match formatting criteria (Tools -> Options -> Editor -> Formatting -> Language:Java -> category: Imports) This is new feature in 7.1, so 7.0.1 does not provide this hint
If the imports are not in alphabetical order the hint is shown with no indication they are not in alphabetical order. Product Version: NetBeans IDE Dev (Build 201111090600) Java: 1.7.0_01; Java HotSpot(TM) Client VM 21.1-b02 System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb) User directory: C:\Users\Mark\.netbeans\dev Cache directory: C:\Users\Mark\.netbeans\dev\var\cache
The problem is not just with empty lines. I get the same warning message. I tried deleting all my imports and letting the editor recreate them. I noticed that my individual java.io imports were replaced with java.io.* I undid those changes and manually replaced my java.io imports with java.io.*. This eliminated the warning message. Personally, I don't the '*' imports. Ralph
OrganizeImports hint should now show its message on the import which gives the problem. http://hg.netbeans.org/jet-main/rev/b3596221487e Please note that the import section formatting criteria can be changed via Tools -> Options -> Editor -> Formatting -> Language:Java -> category: Imports or the hint can be disabled at all.
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/b3596221487e User: Dusan Balek <dbalek@netbeans.org> Log: OrganizeImports hint modified to show its message on the import which gives the problem and not on the first one (see issue #201818).