Bug 49024 - Class moved from default package, formatting
Summary: Class moved from default package, formatting
Status: RESOLVED DUPLICATE of bug 58724
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 trivial (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-17 10:25 EST by Hasko Heinecke CLA
Modified: 2004-04-30 11:22 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hasko Heinecke CLA 2003-12-17 10:25:51 EST
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.
Comment 1 Olivier Thomann CLA 2004-01-19 10:01:33 EST
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.
Comment 2 Olivier Thomann CLA 2004-01-22 13:39:31 EST
Ok to close?
Comment 3 Olivier Thomann CLA 2004-02-18 15:42:41 EST
Closing as WORKSFORME.
Reopen if it doesn't work as expected using the new formatter.
Comment 4 Hasko Heinecke CLA 2004-02-19 04:02:33 EST
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...
Comment 5 Olivier Thomann CLA 2004-02-19 07:43:45 EST
You can define your own settings that should be chosen in case of formatting. I
don't see why I would change the defaults.
Comment 6 Hasko Heinecke CLA 2004-02-19 08:23:50 EST
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.
Comment 7 Olivier Thomann CLA 2004-03-15 13:29:52 EST
Defer to M9 because of 1.5 effort.
Comment 8 Olivier Thomann CLA 2004-04-20 13:02:40 EDT
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.
Comment 9 Olivier Thomann CLA 2004-04-30 11:22:10 EDT
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 ***