Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 227310 - Missing feature "preserve x number of empty lines"
Missing feature "preserve x number of empty lines"
Status: RESOLVED DUPLICATE of bug 106815
Product: editor
Classification: Unclassified
Component: Formatting & Indentation
All All
: P3 with 3 votes (vote)
: 7.4
Assigned To: Dusan Balek
Depends on:
  Show dependency treegraph
Reported: 2013-03-11 18:57 UTC by StanKurdziel
Modified: 2013-06-28 18:16 UTC (History)
4 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description StanKurdziel 2013-03-11 18:57:27 UTC
Eclipse has a feature allowing the formatting spec to allow a certain number of blank lines.  Window->Preferences, Java->Code Style->Formatter, Edit Profile: Blank Lines tab, "Number of empty lines to preserve"

This allows the developer to format their code in the most readable manner, while still enforcing formatting rules.

A simple example is:

class Car {
  String name;

  Color color;  

  double rightWheelSpeed;
  double leftWheelSpeed;

Netbeans settings only allow forcing a space before or after ALL fields, or forcing no spaces between ALL fields. However, it's common java style to have groups of fields with no spaces inside the group and spaces between groups. In the example class above, it's much less readable to force a space between the right and left speed variables. It's also can be much less readable to remove the space above annotations for variables that have annotations.

Allowing the user to maintain up to a certain number of spaces (I've always had mine set to 1), without forcing those spaces, results in the most readable code, and prevents the desire to not use the formatter.
Comment 1 Michel Graciano 2013-05-21 19:37:03 UTC
It is one feature that I really would enjoy to see implemented :)
Comment 2 Michel Graciano 2013-06-28 17:57:08 UTC
Guys, it is already implemented for 7.4. There is two new options named 'Maximum Blank Lines' which already cover this issue IMO. Could someone close this, hopefully pointing to the fixed issue?
Comment 3 Michel Graciano 2013-06-28 18:16:13 UTC
Finally found it. Thanks Dusan :-)

*** This bug has been marked as a duplicate of bug 106815 ***

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo