Community
Participate
Working Groups
Created attachment 98789 [details] required changes to make the test green again I20080502-0100 Recent changes in the comment formatter (bug 230184) lead to a failing CleanUpStressTest. We might need to adjust the test.
Needs to be fixed for RC1
Frederic? Can you review? IMHO this looks wrong. The comment alignment was better before.
The problem was when splitting line comments, the new comment on the line after started after the first one. E.g: // comment needs to be split was formatted as: // comment needs // to be split In this small example, you can see that the second line is longer than the first one, but it would have been really hard for the formatter to figure out that in case of the line max length was just after the word 'needs', the comments would need to be split in three lines: // comment needs // to be // split So, I changed the rule and now the comment formatter adds one indentation less on the second line while splitting and so format as follows: // comment needs // to be split If you definitely think this is worst, then please reassign the bug to me instead of applying the changes on CleanUpStressTests and I'll try to see I could see for another fix for this issue...
This was due to a side effect of fix for bug 230184.
It seems that my explanation in comment 1 was not really clear... I'll try to make it better! Set the formatter comment line max length to 40. Set the Java editor to use a non-proportional font (e.g. Courier New), text margin to 40 and display the margin in the editor. Now, open a java editor on the following simple test case: public class X { // This comment will need to over the max line length } If the formatter preferences was changed from Eclipse built-in, then the test case will be formatted as follow: public class X { // This comment will // need to over the max // line length } Note that, in bugzilla, tabs are 8 characters (and I cannot see any way to change it) so the pasted formatted output looks strange but with 4 chars per tab it would have looked like: public class X { // This comment will // need to over the max // line length } The problem with this output is that the second line is still over 40 chars. I tried to fix this issue but it seems that my fix was not good enough. In fact the expected formatted output should be: public class X { // This comment will // need to over the // max line length }
Created attachment 98890 [details] Proposed patch While fixing bug 230184, the initial indentation level was wrongly modified while printing line comments.
Olivier, could you please review? We need to release the patch before today's integration build otherwise the JDT/UI CleanUpStressTests will fail. Note that this change has no impact on Eclipse 3.0 full-src and Ganymede workspaces tests, I still get respectively 5 and 21 failures (same numbers than last released fix - see bug 230230)
+1
Released for 3.4RC1 in HEAD stream.
Verified for 3.4RC1 using build I20080510-2000.