Bug 230184 - [formatter] New comment formatter split comment line between contiguous tokens
Summary: [formatter] New comment formatter split comment line between contiguous tokens
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 RC1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-05 07:42 EDT by Frederic Fusier CLA
Modified: 2008-05-13 06:46 EDT (History)
3 users (show)

See Also:
jerome_lanneluc: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2008-05-05 07:42:57 EDT
Using 3.4M7

The new comment formatter split comment incorrectly splits comment lines between contiguous tokens as shown in following sample:
public class X {

boolean inTitle;

void foo(String tagName) {
    inTitle = tagName.equals("<title"); // keep track if in <TITLE>
}
}

formatted as follow with maximum line width for comments = 70:
public class X {

    boolean inTitle;

    void foo(String tagName) {
        inTitle = tagName.equals("<title"); // keep track if in <TITLE
                                            // >
	}
}

Although we should get:
public class X {

    boolean inTitle;

    void foo(String tagName) {
        inTitle = tagName.equals("<title"); // keep track if in
                                            // <TITLE>
	}
}
Comment 1 Frederic Fusier CLA 2008-05-05 07:46:00 EDT
The Scribe.printLineComment(int,int) method also needs to put contiguous tokens into temporary buffer before print them. The same mechanism used for block and javadoc comments also has to be used for line comments.
Comment 2 Frederic Fusier CLA 2008-05-06 05:49:34 EDT
The patch fixing this issue has been attached to bug 230230.
Jerome can you please review?
Comment 3 Frederic Fusier CLA 2008-05-06 07:08:12 EDT
Released for 3.4RC1 in HEAD stream.
Comment 4 Eric Jodet CLA 2008-05-13 06:46:28 EDT
Verified for 3.4RC1 using build I20080510-2000.