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.
Initial code: public class EmptyLines { //An int int i; //Another int int j; 1. Open option panel and go to editor ->Formatting-> java -> Blank Lines 2. Set 0 as Minimum Blank Lines for ALL the options except "Before Field" 3. Set 3 as Minumum Blank Lines for "Before Field" 4. Apply the changes and hit ALT + SHIFT + F to format the code Actual Result: public class EmptyLines { //An int int i; //Another int int j;
It seems that this issue is not related only to the field comments. Another example is: public class EmptyLines { /*m1*/ public void m1() { } /*m2*/ public void m2() { In option all minimum number of blank line = 0 except before method that is = 3 Formatting there is this situation: public class EmptyLines { /*m1*/ public void m1() { } /*m2*/ public void m2() {
Issue occurs when going from a smaller number of blank lines to a larger number of blank lines. Formatting the code a second time puts the correct amount of blank lines in. For example: public class EmptyLines { //An int int i; //Another int int j; Before Field: 3 blank lines Reformat public class EmptyLines { //An int int i; //Another int int j; Reformat again public class EmptyLines { //An int int i; //Another int int j;
Issue is reproducible. Product Version: NetBeans IDE Dev (Build 201508310002) 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)
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/c5e1fdb193b8
Integrated into 'main-silver', will be available in build *201509030002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/c5e1fdb193b8 User: Dusan Balek <dbalek@netbeans.org> Log: Issue #254372 - Wrong number of blank line in field comments - fixed.
Verified works as expected in Build: 201509140002