Community
Participate
Working Groups
Build ID: I20070621-1340 Steps To Reproduce: 1. Start with default Code Formatter settings: Eclipse: [built-in] 2. Set Indentation -> Tab Policy to 'Spaces only' 3. On Comments->General Settings turn OFF all 3 comment formatting settings. 4. Enter this code fragment: public class test { int x = 0; /* * XXXX */ } 5. Run the formatter - the last two lines of the block comment are indented 3 spaces to the right. 6. Run the formatter AGAIN - the last two lines of the block comment are indented AGAIN. And so on... 7. Fragment after 6 executions of formatter looks like this: public class test { int x = 0; /* * XXXX */ } More information:
I forgot to say it worked ok in Eclipse 3.2 - inasmuch as it formatted the code only once to leave a 4-space indent before the last lines of the block comment: int x = 0; /* * For */ Repeated applications of the formatter did not change it further.
The code formatter is owned by core
should be fixed with bug 102780
(In reply to comment #3) > should be fixed with bug 102780 > It's fixed when block formatting is set ON; you get following output at the first formatting and never change after even with several repetitions: public class test { int x = 0; /* * XXXX */ } However, the problem still occurs when it's OFF...
Created attachment 126872 [details] Proposed patch
Created attachment 127007 [details] New proposed patch This patch is little bit less aggressive... With previous patch, when the block comment was /* * comment */ a space was inserted before the beginning star of each line when the indentation was applied: /* * comment */ As it was not possible to know whether the comment initial indentation was intentional or not, I finally thought this was better to keep this behavior unchanged although the final result is less pretty than with previous patch... :-( So, now the output is (as it was before the fix): /* * comment */
Released for 3.5M6 in HEAD stream.
Verified for 3.5M6 with build I20090309-0100