Bug 256799

Summary: [formatter] Formatter wrongly adds space to //$FALL-THROUGH$ is
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jerome_lanneluc, philippe_mulet
Version: 3.5   
Target Milestone: 3.5 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Dani Megert CLA 2008-11-27 11:01:42 EST
N20081126-2000.

The formatter wronglys adds space to //$FALL-THROUGH$ i.e. it becomes:
// $FALL-THROUGH$

The correct format we agreed upon is //$FALL-THROUGH$ without a space.
Comment 1 Frederic Fusier CLA 2008-12-01 07:07:08 EST
What should we do for the block comment tag /*$FALL-THROUGH$*/ which currently is formatted as:
/* $FALL-THROUGH$ */
(i.e. like an usual block comment)?
Comment 2 Dani Megert CLA 2008-12-01 07:13:23 EST
You could do the same as for NON-NLS: there it looks as if you don't touch the current formatting i.e. if I write //$NON-NLS or // $NON-NLS it is both honored/not touched. Same could be done for fall-through.
Comment 3 Frederic Fusier CLA 2008-12-03 15:48:54 EST
Created attachment 119428 [details]
Proposed patch

If I agreed for line comment to behave like NON-NLS tag, I do not think this add any value for user to do the same for block comment. Set fall through tags using block comment is not recommended, just tolerated by the compiler. So, we can let the formatter considering them as usual block comment, hence systematically adds space at the beginning and at the end of the comment...
Comment 4 Frederic Fusier CLA 2008-12-04 06:08:33 EST
Released for 3.5M4 in HEAD stream.
Comment 5 Kent Johnson CLA 2008-12-09 13:46:25 EST
Verified for 3.5M4 using I20081209-0100