Community
Participate
Working Groups
When I move a class from the default package to a named package, a blank line should be inserted after the "package" statement in the source. Currently, the class declaration or the imports follow directly in the next line which is ugly.
Are you using the new formatter? If yes, you can set the number of lines that you want to be inserted after the package declaration.
Ok to close?
Closing as WORKSFORME. Reopen if it doesn't work as expected using the new formatter.
I can change the formatting to include more blank lines. However, I'm reopening because the default formatting is really not very nice: No blank lines at all. The default should be what most(?) people expect: One blank line between package and import, before class declaration, before field declaration block, and between method declarations. Leave blank lines should be set to 1. This is, of course, only a matter of style...
You can define your own settings that should be chosen in case of formatting. I don't see why I would change the defaults.
I'm not asking you to change the defaults. I'm asking you to set them back to what they were. ;-) As it is now, the default formatting has changed for no obvious reason with respect to blank lines. This will certainly annoy people moving from 2.x to 3.0. I guess I talking about the principle of the least surprise here. It's great to have the new possibilities and the formatting generally behaves much better now. But why change the part of the default behavior that we had before and that was good? Besides - and this is my own unimportant personal opinion, of course - throwing out all blank lines by default is just not very nice. YMMV.
Defer to M9 because of 1.5 effort.
In fact the default is the same. The difference is that before the source was not formatted in a move operation. Now it seems to be the case. If you try to format a file that contains a blank line between the package declaration and the type declaration (no import declarations) using the default settings of the code formatter in 2.1.3, the blank line is removed. I will check using today's build what happens if I change the default settings.
Default settings have been changed to preserve one blank line. No blank lines are added by default, but if they exist, one is preserved. Close as a duplicate of bug 58724. *** This bug has been marked as a duplicate of 58724 ***