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 178381 - Multiline Alignment with Binary Operators
Summary: Multiline Alignment with Binary Operators
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2009-12-09 09:45 UTC by majiknet
Modified: 2010-02-16 03:57 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description majiknet 2009-12-09 09:45:35 UTC
In 6.8, automatic formatting for multiline alignment seems to have changed from 6.7. If I manually add a line-break after an operator, then in 6.7 it would align correctly with the start of the expression. In 6.8, it now removes the line-break and returns the remainder of the statement back to the original line. This does not happen if the line-break is before the operator, only when it is after.

As an example:

int a = 1 +

"Source > Format" becomes:

int a = 1 + 2;

However, if I start with:

int a = 1
+ 2;

"Source > Format" becomes:

int a = 1
        + 2;

This is throwing a number of checkstyle errors at me as I'm wanting the operator to be before the break, and not at the start of the new line.
Comment 1 Jiri Prox 2009-12-09 11:33:18 UTC
The formatter follows java formatting conventions. 
But definitely there is a space for more formatting settings