Bug 50900

Summary: [formatting] comment indention
Product: [Eclipse Project] JDT Reporter: Sebastian Davids <sdavids>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Sebastian Davids CLA 2004-01-29 14:38:51 EST
@@ original @@

    void endlineComment() {
        System.out.println("            ");
//veeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeery endline comment
    }

@@ after formatting @@

    void endlineComment() {
        System.out.println("            "); //veeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeery
                                            // endline comment
    }

@@ after formatting a second time @@

    void endlineComment() {
        System.out.println("            "); //veeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeery
        // endline comment
    }

@@@@

Is this intented?

Why is the new alignment of the first run not preserved by the second run?
Comment 1 Sebastian Davids CLA 2004-01-29 14:39:42 EST
The endline comment in the original is after the System.out.println("          
 "); statement.
Comment 2 Olivier Thomann CLA 2004-01-29 17:30:11 EST
This is a side-effect of having the line comment split.
The code formatter indents the comments relative to the current indentation, but
it doesn't split line comment.
Move to JDT/Text.
Comment 3 Dani Megert CLA 2004-02-03 05:30:03 EST
If this bug is about the indentation i.e. step 2 then please reopen and move to
JDT Core.


*** This bug has been marked as a duplicate of 47620 ***
Comment 4 Sebastian Davids CLA 2004-02-03 07:14:32 EST
I'll wait and see how bug 47620 turns out.

The main point of this bug would be:

Two consecutive runs of the formatter (with the same settings) should produce
exactly the same result.

And right now it's not the case.