Community
Participate
Working Groups
Eclipse 3.2 This seems to hit an integration problem between the compiler and APT. Setting the compiler to mark non-externalized strings as errors does not work properly for code annotated with SupressWarnings("nls") (or "all"). The effect is that the compiler will generate code throwing an error for unresolved compilation problems, but the IDE will show no indication that the code has errors. The only way of finding out about the errors is by running the code. The expected effect is that either markers are created for non-externalized strings, or the compiler generates code that does not report errors (the former is better). To reproduce, create a Java project with project-specific compiler settings that will report non-externalized strings as compiler errors, and put the class below in it: public class Main { @SuppressWarnings("nls") public static void main(String[] args) { System.out.println("Hello World!"); } }
SuppressWarnings is designed to remove warnings not errors. If you set them as error, then simply fix them. SuppressWarnings as its name says is used to remove warnings. So leave them as warnings and use SuppressWarnings where you don't want them to be reported. Closing as INVALID.
What I said is that if I set non-externalized strings to be signaled as errors, no problem markers will be created by the builder for code that is annotated with SuppressWarnings("nls"). This is what is wrong. > SuppressWarnings is designed to remove warnings not errors. This is *exactly* what this PR is about. SuppressWarnings is suppressing errors (it shouldn't, it should only suppress warnings), but the compiler is properly "reporting" them (by generating code that throws an error). Reopening for reconsideration. If this is APT (not Core) please reassign as appropriate.
Reproduced.
Sorry I read it too quickly. I believe the fix is quite simple. I'll run our tests before releasing it. It won't be part of 3.3M3 since our contribution for M3 is already done.
Created attachment 53020 [details] Proposed fix
Created attachment 53022 [details] Updated regression tests
No worries. Thanks for promptly looking into it.
Released for 3.3M4.
Verified for 3.3 M4 using build I20061212-0010.