Community
Participate
Working Groups
Build ID: Build id: I20080617-2000 Steps To Reproduce: Formatting source is not keeping the correct format. Looking at More Information and you will see what's happening. The same comment snippet used to work on eclipse 3.3. Tried to export preferences from eclipse 3.3 and import to eclipse 3.4 also didn't work (ketan mentioned). On eclipse 3.3 I was using eclipse built-in code formatter and that code snippet always worked on 3.x. More information: 3.4 /* * ---------------------------------------------------------- END OF SETS * AND GETS---------------------------------------------------------- */ 3.3 /*---------------------------------------------------------- * SETS AND GETS *----------------------------------------------------------*/ 3.4 Enabled block comment disabled /*---------------------------------------------------------- * END OF SETS AND GETS * test test test test test test test test test test test test test test test test test test test test test * * *----------------------------------------------------------*/
(In reply to comment #0) > Build ID: Build id: I20080617-2000 > > Steps To Reproduce: > Formatting source is not keeping the correct format. > Looking at More Information and you will see what's happening. The same comment > snippet used to work on eclipse 3.3. > > Tried to export preferences from eclipse 3.3 and import to eclipse 3.4 also > didn't work (ketan mentioned). > > On eclipse 3.3 I was using eclipse built-in code formatter and that code > snippet always worked on 3.x. > > > > More information: > 3.4 > > /* > * ---------------------------------------------------------- END OF SETS > * AND GETS---------------------------------------------------------- > */ > > 3.3 > > /*---------------------------------------------------------- > * SETS AND GETS > *----------------------------------------------------------*/ > > > > 3.4 Enabled block comment disabled > /*---------------------------------------------------------- > * END OF SETS AND GETS > * test test test test test test test test test test test test test test test > test test test test test test > * > * > *----------------------------------------------------------*/ > --> 3.4 Enabled block comment disabled* -> Block comment disabled
Im' not sure to really get your test case... It seems that the initial comment (i.e. before formatting) is: /*---------------------------------------------------------- * END OF SETS AND GETS * test test test test test test test test test test test test test test test test test test test test test * * *----------------------------------------------------------*/ as you said it's the result when the block comment preference is disabled. Wat it really the comment you formatted? If so, how could you get: /* * ---------------------------------------------------------- END OF SETS * AND GETS---------------------------------------------------------- */ with 3.4 formatter? and: /*---------------------------------------------------------- * SETS AND GETS *----------------------------------------------------------*/ with 3.3 one? Could you also precise what is the profile used while formatting (Eclipse/Java conventions built-in or specific one)? Thanks
I was using Eclipse built-in profile. But I tried with all others and the same thing was happening. Regarding Eclipse 3.3: Version: 3.3.2 Build id: M20080221-1800
(In reply to comment #3) > I was using Eclipse built-in profile. > > But I tried with all others and the same thing was happening. > > Regarding Eclipse 3.3: > > Version: 3.3.2 > Build id: M20080221-1800 > I was also asking for a clarification of your test case... There's not only formatting between initial comment and the outputs of 3.3 and 3.4 versions, is there?
OK, assuming that the initial test case is: /*--------------------- * END OF SETS AND GETS * test test test test test test test test test test test test test * * *---------------------*/ Using Eclipse built-in + 'Maximum line width for comments' = 40 The output with 3.3 formatter is: /*--------------------- * END OF SETS AND GETS * test test test test test test test test test test test test test * * *---------------------*/ although with 3.4 formatter it is: /* * --------------------- END OF SETS * AND GETS test test test test test * test test test test test test * test test * * * --------------------- */ It seems that bug 230944 was not completely fixed. When /*- is followed by another dash, the formatter still does not respect the tacit contract not to format the block comment... It works for all other characters than '-', I'll investigate...
While formatting the block comment, the scribe looks at the token just after the starting /*. Currently if does not format the comment if the token is TokenNameMINUS, but it must also do the same when the token is TokenNameMINUS_MINUS which is the case for this bug...
Created attachment 110537 [details] Proposed patch
Released for 3.5M2
Jerome, can we consider this fix to be backported to 3.4.1 as this is a regression since 3.3.2? There's no data loss but the benefit would be interesting as I found several block comments with this pattern in Ganymede source files...
+1 for 3.4.1 since this is a regression comparing to 3.3.2
Created attachment 110588 [details] Proposed patch for R3_4_maintenance branch
Released for 3.4.1
Verified for 3.4.1 using M20080827-2000
Verified for 3.5M2 using I20080914-2000