Community
Participate
Working Groups
In the java code formatter, when specifying line wrapping options for Method declarations, it seems that the final bracket is being ignored. To test: In the line wrapping tab of the code formatting "Edit Profile" dialog, set the line width for preview window to 69. Select "Method Declarations: Parameters" The final bracket from the method declaration is beyond the 69 character limit.
Right now the final bracket is not part of the wrapping mecanism.
*** Bug 135519 has been marked as a duplicate of this bug. ***
By "bracket", I'm assuming you mean brace? At first I thought this was an off-by-one error since you can work around it by reducing your allowed line length by one. This one is high on the annoying list for me.
See also Bug 69585
Created attachment 50589 [details] Java source affected by this bug Here's an example of Java source affected by this bug. Note that on lines 49 & 50, the method parameter itself exceeds the maximum line length and is correctly wrapped, but line 58 is not wrapped despite exceeding the maximum line length with the space and { at the end of the line. Note that in this situation, I wouldn't want the { to be wrapped by itself, but rather I would want it to break at column 41 and wrap the method parameter onto the next line as with lines 49 & 50.
Created attachment 50594 [details] Formatter settings for the previous attachment
I don't know if this bug was ever solved, but it has resurfaced in 3.2.2 [build M20070212-1330]. Here is my example. I have the line wrap set at 115. And here is the output: <TAB>public ItemModel(String name, String description, double length, double width, double height, double strength) { However, the output should be: <TAB>public ItemModel(String name, String description, double length, double width, double height, <TAB><TAB>double strength) {
I surely will not have enough time to fix your bug during the 3.5 development process, hence set its priority to P5. Please provide a patch if you definitely need the bug to be fixed in this version and I'll have a look at it... TIA
There is a workaround: go to the 'Braces' tab while editing formatter select 'Next line on wrap' in the 'Method declaration' Then the opening brace will be moved to the next line if necessary.
*** Bug 299473 has been marked as a duplicate of this bug. ***
Still present in 4.4
This problem no longer occurs after the formatter redesign. *** This bug has been marked as a duplicate of bug 303519 ***