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 254372 - [81cat] Wrong number of blank line in field comments
Summary: [81cat] Wrong number of blank line in field comments
Status: RESOLVED FIXED
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 12:52 UTC by -Silver-
Modified: 2015-09-14 14:34 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 12:52:42 UTC
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;
Comment 1 -Silver- 2015-08-14 13:03:57 UTC
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() {
Comment 2 georgia01 2015-08-28 15:34:28 UTC
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;
Comment 3 stwr 2015-09-01 10:26:26 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 14:10:19 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/c5e1fdb193b8
Comment 5 Quality Engineering 2015-09-03 01:24:30 UTC
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.
Comment 6 manikantannaren 2015-09-14 14:34:03 UTC
Verified works as expected in Build: 201509140002