Bug 260276 - [formatter] Inconsistent formatting of one-line block comment
Summary: [formatter] Inconsistent formatting of one-line block comment
Status: VERIFIED DUPLICATE of bug 239607
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.2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-07 12:07 EST by Frederic Fusier CLA
Modified: 2009-02-04 03:49 EST (History)
4 users (show)

See Also:


Attachments
Patch to fix the failing test in CodeFormatterTest (919 bytes, patch)
2009-01-09 10:14 EST, 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 2009-01-07 12:07:30 EST
I saw the following issue while working on fix for bug 254998...

Consider the following test case:
class X {
/* a
comment */
}

Format this code using 3.4.1 or 3.5M4 using Eclipse built-in profile, produces
the following output:
class X {
    /* a comment */
}

but formatting it with 3.3.2, produces:
class X {
    /*
     * a comment
     */
}

It looks like a regression introduced by the new comment formatter...

This would have been not too bad if the formatter didn't behave inconsistently on a slightly different test case:
class X {
/* a
 comment */
}

is formatted as:
class X {
    /*
     * a comment
     */
}
by all versions!
Comment 1 Frederic Fusier CLA 2009-01-07 12:11:19 EST
Dani,
Change for this bug will break testFormatElementInComment() test in CodeFormatterTests. I'll attach corresponding patch when I'm ready to release in HEAD...
Comment 2 Frederic Fusier CLA 2009-01-09 10:12:10 EST
Fixed by the patch attached to bug 254998:
https://bugs.eclipse.org/bugs/attachment.cgi?id=122118

So, released for 3.5M5.
Comment 3 Frederic Fusier CLA 2009-01-09 10:14:57 EST
Created attachment 122122 [details]
Patch to fix the failing test in CodeFormatterTest
Comment 4 Markus Keller CLA 2009-01-09 11:58:06 EST
(In reply to comment #3)
> Created an attachment (id=122122) [details]
> Patch to fix the failing test in CodeFormatterTest 

Thanks for the heads up. Fixed in HEAD.
Comment 5 Frederic Fusier CLA 2009-01-13 12:32:40 EST
Fortunately, the patch for bug 239607:
https://bugs.eclipse.org/bugs/attachment.cgi?id=122271
also fixes this issue...

So, released for 3.4.2
Comment 6 Frederic Fusier CLA 2009-01-13 12:40:46 EST
As there's no real code change for this bug, set as a duplicate of bug 239607

*** This bug has been marked as a duplicate of bug 239607 ***
Comment 7 Srikanth Sankaran CLA 2009-01-27 01:58:48 EST
Verified for 3.5M5 using I20090125-2000 build.
Comment 8 David Audel CLA 2009-02-04 03:49:24 EST
Verified for 3.4.2 using M20090127-1710.