Summary: | Code formatter adds an unwanted blank line after an abstract method with a "throws" clause. | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Deven T. Corzine <deven> | ||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | 3.0 | ||||||
Target Milestone: | 3.0 M7 | ||||||
Hardware: | PC | ||||||
OS: | Windows 2000 | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Deven T. Corzine
2003-05-27 11:19:26 EDT
This is addressed in the new formatter. Fixed and released in HEAD. Regression test added. Verified. This bug was filed against version 2.1, but it also exists in version 3.0M6, with exactly the same broken behavior -- even though this bug WAS previously fixed. If a regression test was added, why didn't it catch this regression? Created attachment 7588 [details]
Screen shot to set the new formatter
Are you using the new formatter?
The old formatter won't be fixed. The fix is in the new formatter. So if you
switch to the new formatter, it should work as expected.
I checked it using a M6 build.
See the screen shot to see how to use the new formatter.
Close as fixed in the 3.0 stream.
Close as FIXED. No, I wasn't using the new formatter. I had no idea that "new formatter" was a different mode entirely -- I assumed it meant just a newer version of the code. It's strange, though -- I seem to recall testing (with the old formatter) and seeing that the bug was fixed. Or maybe I'm misremembering -- it seems to be broken on the 3.0 milestone from August 28 I was using before today... Anyway, the new formatter does not appear to be adding these unwanted blank lines, although it doesn't remove them if they're already there (say, from a previous auto-format from the old formatter) -- is this a bug? You have to check the value of the number of blank lines to preserve. In your case, you want zero. See the code formatter preference page. You can define your own settings. If I understand that setting correctly, it won't do what I want. If a blank line appears in the middle of the declaration like this bug created under the old formatter, I would want the formatter to remove that blank line. Similarly, if there are blank lines in the middle of a statement being formatted that wouldn't normally be there, I'd want those removed too. However, I want to keep blank lines (or at least one) between statements, since I regularly group statements by strategic use of blank lines in the code. It seems that I can't do both at the same time. If I set the number of lines to preserve to zero, won't it remove all my carefully-placed blank lines between groups of statements? You are right. There is no way to have both. In your case, get rid of your extra line and it won't be added again when you format your code. Would it be feasible to add an option for the number of blank lines to preserve between statements? There's already a lot of fine-grained control, so why not? |