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 254361 - [81cat] Wrong "Before Field" blank line check
Summary: [81cat] Wrong "Before Field" blank line check
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-14 08:42 UTC by -Silver-
Modified: 2015-09-02 13:59 UTC (History)
1 user (show)

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 -Silver- 2015-08-14 08:42:41 UTC
Test:
http://services.netbeans.org/synergy/client/app/#/assignment/1397/v/1

Having this code:

public class EmptyLines {
	 int i;
	 int j;

1. From formatting -> blank lines options set the minimum number of blank line before field to 3
2. Hit ALT + SHIFT + F to format the code

The actual result is this:

public class EmptyLines {
	 int i;



	 int j;

Expected result: A minimum of 3 Blank lines were added also before int i; field.
Comment 1 manikantannaren 2015-08-24 06:34:59 UTC
Build: 201508230002
The actual behaviour now is 
public class EmptyLines {

    int i;



    int j;

while it should be
public class EmptyLines {



    int i;



    int j;
Comment 2 Jiri Prox 2015-08-25 11:26:19 UTC
reproducible
Comment 3 stwr 2015-09-01 09:59:29 UTC
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)
Comment 4 Dusan Balek 2015-09-02 12:56:29 UTC
This is as designed behaviour. The number of blank lines before the first class member is given by the 'Minimum Blank Lines After Class Header' option. Similarly, the number of blank lines after the last class member is given by the 'Minimum Blank Lines Before Class Closing Brace' option.
Comment 5 stwr 2015-09-02 13:59:25 UTC
As you wrote it is MINIMUM number of blank lines.

The value '3' set for minimum number of blank lines before field does also fit to minimum number of blank lines after class header = '1'. 1 would be minimum and the maximum is not defined.