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.
Product Version: NetBeans IDE 8.1 Beta (Build 201507302201) Java: 1.8.0_60-ea; Java HotSpot(TM) 64-Bit Server VM 25.60-b23 Runtime: Java(TM) SE Runtime Environment 1.8.0_60-ea-b25 System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb) User directory: C:\Users\cendrowiczm\AppData\Roaming\NetBeans\8.1beta Cache directory: C:\Users\cendrowiczm\AppData\Local\NetBeans\Cache\8.1beta --Preparation-- Download the Formatting project available for this test specification --> http://services.netbeans.org/synergy/client/app/#/specification/297/v/2 --Use Case-- 1. Change the Formatting options like it is shown on the picture 'Formatting Options' 2. Make sure the IDE is showing the hint 'Organize imports' 3. Open imports.Count class 4. Remove all imports if any 5. Use following imports: //imports start here import java.util.*; import static imports.anotherpackage.AuxClass.m1; import static imports.anotherpackage.AuxClass.m2; import static imports.anotherpackage.AuxClass.m3; import static imports.anotherpackage.AuxClass.m4; //imports end here --Expected result-- First import ('java.util.*') is marked as the first line which does not fit to the specified code style rules. --Actual result-- First static import ('imports.anotherpackage.AuxClass.m1') is marked as the first line which does not fit to the specified code style rules. See the 'Result' picture. --Thoughts-- I started to wonder when could the Formatter realize that first static import is actually the first bad line. My answer was - maybe it answers the question 'what should I find at this line?' having, of course, specified rules. The answer could be 'I should find here some java.util.XYZ import'. But then...why the Formatter's answer was bad for the question 'what should I find at line with 'import java.util.*'? :) Maybe it is the problem with star imports only.
Created attachment 155076 [details] Formatting Options
Created attachment 155077 [details] Result
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/17afadd89f45
Integrated into 'main-silver', will be available in build *201508010002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/17afadd89f45 User: Dusan Balek <dbalek@netbeans.org> Log: Issue #254025 - Incorrect calculation of first invalid line (according to specified import rules) - fixed.
*** Bug 253820 has been marked as a duplicate of this bug. ***