Bug 231060 - [formatter] '*' are not preserved in Javadoc comments when located at the beginning of the line
Summary: [formatter] '*' are not preserved in Javadoc comments when located at the beg...
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-08 04:17 EDT by Frederic Fusier CLA
Modified: 2008-05-13 09:42 EDT (History)
3 users (show)

See Also:
Olivier_Thomann: review+


Attachments
Proposed patch (6.81 KB, patch)
2008-05-08 08:24 EDT, Frederic Fusier CLA
no flags Details | Diff

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

Using the following test case:
public class X {

    void foo() {
        /**
         * This example will put the star at the beginning of next line: R1 = X1 * 2
         */
        int b;
    }
}

After the format using default Eclipse built-in, I get:
public class X {

    void foo() {
        /**
         * This example will put the star at the beginning of next line: R1 = X1
         * * 2
         */
        int b;
    }
}

Which looks OK. But if I format this again, I get:
public class X {

    void foo() {
        /**
         * This example will put the star at the beginning of next line: R1 = X1
         * 2
         */
        int b;
    }
}

The star at the beginning of the line has been wrongly removed!
Comment 1 Frederic Fusier CLA 2008-05-08 04:18:13 EDT
This must be fixed for 3.4 as some text is removed while formatting!
Comment 2 Frederic Fusier CLA 2008-05-08 08:24:00 EDT
Created attachment 99260 [details]
Proposed patch
Comment 3 Frederic Fusier CLA 2008-05-08 08:25:10 EDT
With this patch, I now get NO failure on Eclipse 3.0 full source workspace test and 17 on Ganymede workspace test.
Olivier, could you please review?
Comment 4 Olivier Thomann CLA 2008-05-08 13:10:14 EDT
Patch looks good.
+1 for 3.4RC1.
Comment 5 Frederic Fusier CLA 2008-05-08 15:02:18 EDT
Released for 3.4RC1 in HEAD stream.
Comment 6 Eric Jodet CLA 2008-05-13 09:41:43 EDT
Verified for 3.4RC1 using build I20080510-2000.

Note: found a difference between the "old" and the "new" formatter, but also found that the "new" formatter seems better.

old:
/**
 * This example will put the star at the beginning of next line: R1 = X1 *
 * 2
 */

--> the star after X1 is after the 80 margin limit

new:
/**
 * This example will put the star at the beginning of next line: R1 = X1
 * * 2
 */
Comment 7 Eric Jodet CLA 2008-05-13 09:42:47 EDT
Verified for 3.4RC1 using build I20080510-2000.