Bug 302123

Summary: [formatter] AssertionFailedException occurs while formatting a source containing the specific javadoc comment /** ***/
Product: [Eclipse Project] JDT Reporter: Frederic Fusier <frederic_fusier>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ivan.motsch, jose, Olivier_Thomann, remy.suen
Version: 3.5.1   
Target Milestone: 3.6 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Frederic Fusier CLA 2010-02-08 06:52:37 EST
+++ This bug was initially created as a clone of Bug #300162 +++

Build Identifier: M20090917-0800

As said in bug 300162 comment 4, there's  first problem described in comment 0 is fixed in 3.6
since bug 294529 has been fixed...

However, there's still an AssertionFailedException while formatting the following simple test:

package format.test;

public class Test {
    public static void main(String[] args) {
        String s="X"+/** ***/"Y";
    }
}
Comment 1 Frederic Fusier CLA 2010-02-08 06:55:27 EST
The problem comes from the FormatterCommentParser which wrongly stores the first star of the 3 ending ones as the end of the javadoc text, although it should store the last star position instead...
Comment 2 Frederic Fusier CLA 2010-02-08 11:10:20 EST
Created attachment 158477 [details]
Proposed patch

The proposed solution is to not push the last text when there are contiguous stars at the end of the javadoc comment...
Comment 3 Frederic Fusier CLA 2010-02-09 03:59:16 EST
Released for 3.6M6 in HEAD stream.
Comment 4 Olivier Thomann CLA 2010-03-08 13:28:00 EST
Verified for 3.6M6 using I20100307-2000.