Community
Participate
Working Groups
Using 3.6M6 but I guess this happens since day 1. Consider the following test case: public class Test { void foo() { bar("a non-nls string", 0 /* a comment */); //$NON-NLS-1$ } void bar(String string, int i) { } } Format it using the Eclipse built-in profile + spaces only + max line width=40, then you get: public class Test { void foo() { bar("a non-nls string", 0 /* * a * comment */); //$NON-NLS-1$ } void bar(String string, int i) { } } Unfortunately the formatter, while touching the block comment, breaks the NON-NLS tag effect and may potentially add two warning/errors on the CU if the compiler options has been set to reveal non-nls strings usage...
This problem exists since at least 3.0...
Created attachment 162501 [details] Proposed patch With this patch, the formatter skips the block comments when its formatting will break the line which contains the non-nls tag.
Released for 3.6 M7 in HEAD stream.
Created attachment 162505 [details] Proposed patch This is the real proposed patch, previous one was not up-to-date... :-S
Verified for 3.6M7 using build I20100424-2000