Community
Participate
Working Groups
Build ID: I20070625-1500 Steps To Reproduce: 1. suppose you have the following options for the formatter: - maximum line width 80 - default indentation for wrapped lines 2 - use spaces only - indentation size 2 - tab size 2 - for binary expressions, wrap only when necessary, default indentation - for qualified invocations, wrap only when necessary, default indentation - a blank line for the opening brace of "if" statement 2. suppose you have the following line of code: public void a() { if(true) { allocation.add(idx_ta + 1, Double.valueOf(allocation.get(idx_ta).doubleValue() + q)); } } 3. invoke code formatter EXPECTED BEHAVIOUR: I would expect the following output: public void a() { if(true) { allocation.add(idx_ta + 1, Double.valueOf(allocation.get(idx_ta) .doubleValue() + q)); } } OBSERVED BEHAVIOUR: The result is: public void a() { if(true) { allocation.add(idx_ta + 1, Double.valueOf(allocation.get(idx_ta) .doubleValue() + q)); } } More information: It seems that the formatter, when wrapping the binary expression, thinks that the end-of-line is that of the first line (allocation.add(etc.)), instead of that of the second line (.doubleValue()), so that the second line remains much shorter than it could be and "+ q" is wrapped on the third line.
another wrapping to be improved... *** This bug has been marked as a duplicate of bug 59891 ***
Verified for 3.6M7 using I20100426-0852. The line wrapping is improved now.