Bug 47918 - New code Formatter
Summary: New code Formatter
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-02 15:26 EST by Steve Ray CLA
Modified: 2003-12-17 06:22 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Ray CLA 2003-12-02 15:26:19 EST
I have blank lines between methods.  If my method ends with a curly brace it 
leaves the blank line if it ends with a commented curly brace it removes the 
blank line.

e.g.:    } // end constuctor
Comment 1 Olivier Thomann CLA 2003-12-03 10:04:48 EST
What are your formatting options?
Comment 2 Olivier Thomann CLA 2003-12-03 13:44:39 EST
Reproduced. I am investigating.
Comment 3 Olivier Thomann CLA 2003-12-03 14:11:49 EST
Fixed and released in HEAD. Regression tests added.

Test case:
class Example {
    void foo() {}

    void foo2() {} // end of foo2

    void bar() {}
}

New result if at least one blank lines needs to be preserved:
class Example {
    void foo() {
    }

    void foo2() {
    } // end of foo2

    void bar() {
    }
}

Using the new code formatter preference page, you can also add a new line 
before each method without specifying any number of blank lines to be 
preserved.
Comment 4 David Audel CLA 2003-12-17 06:22:56 EST
Verified for 3.0M6