Community
Participate
Working Groups
Build ID: I20080516-1333 Steps To Reproduce: 1. Take a Java source with a block comment like /* * Hello */ 2. Use Source->Format 3. Observer that the comment now looks like this: /* * Hello */ More information: I first observed it I think with 3.4M7. It is still in I20080516-1333. I have added an export of my formatter configuration, in case that matters.
Cannot reproduce using 3.4 RC1. Can you attach a complete example and also attach your formatter settings? Thanks.
Created attachment 100913 [details] Fromatter configuration Sorry, seems attaching didn't work when I submitted the bug.
I just tried to reproduce it myself with a copletly fresh install and a completly new unix user and have seen, that I could only reproduce it after importing my own formatter configuration.
I could reproduce the bug in fresh install of eclipse-SDK-I20080516-1333-linux-gtk.tar.gz without using my formatter configuration with these steps: Enter the workspace. Create a new project Test: File -> New -> Java Project Create a new class Test: File -> New -> Class Make the class look like public class Test { /* * Hello */ } Change the formatter settings: Windows -> Preferences -> Java -> Code Style -> Formatter Edit the "Eclipse [built-in]" format and just set a new profile name and change in the Indentation Tab the "Tab policy" to "Spaces only" and "Indentation size" to 1. Accept and return to workspace Format with Source -> Format Probably only "Indentation size" needs to be set to 1.
Thanks for the steps, I can reproduce it now. I'll investigate. Note that this is a regression introduced by the new comments formatter as this issue does not occur in 3.3 .
Note that this does not happen while formatting javadoc comment: public class Test { /** * Hello */ } is correctly formatted as: public class Test { /** * Hello */ }
Indeed. I have only issues with /* block */ comments, none with /** javadoc */ or // line comments. Sorry for not having stated it clearly enough.
(In reply to comment #7) > Indeed. I have only issues with /* block */ comments, none with /** javadoc */ > or // line comments. Sorry for not having stated it clearly enough. > No problem, we appreciate the time you spent to find a reproducible test case, that helps a lot!
Created attachment 101266 [details] Proposed patch
Jerome, I would propose this patch to be put in RC2 as it fix a regression vs 3.3 formatting and also fixes potential ArithmeticException: "/ by zero" when tab length is set to 0 (3.3 has similar issue when setting the indentation size to 0)!
Created attachment 101272 [details] Proposed patch updated with last HEAD contents
Since this is a regression comparing to 3.3.2, ok to fix it for RC2
Jerome, Eric, could you please review?
Patch looks good: +1
Looks good: +1
Released for 3.4RC2 in HEAD stream.
verified for 3.4RC2 using build I20080523-0100