Summary: | @SuppressWarnings will suppress optional errors, but code will not be generated | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Thomas Thrien <thomas.thrien> |
Component: | Core | Assignee: | Satyam Kandula <satyam.kandula> |
Status: | VERIFIED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | amj87.iitr, satyam.kandula, stephan.herrmann |
Version: | 3.8 | ||
Target Milestone: | 3.8 M5 | ||
Hardware: | PC | ||
OS: | Linux | ||
See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=346175 | ||
Whiteboard: |
Description
Thomas Thrien
2011-10-17 05:57:12 EDT
(In reply to comment #0) > Everything works fine until I moved to Indigo SR1. From that time onwards, > accessing one of the constants in LogLevel returned null. As you might imagine, > it drove me crazy that a line like > > LogLevel.SEVERE.intValue() > > caused a NullPointerException. I did not get an NPE but got a "Unresolved compilation problem" instead on running the program (Adding a main method to your class). This works fine in 3.6.2 though. However, not sure whether this is a bug because even java 7 refuses to run this class. (In reply to comment #1) > (In reply to comment #0) > > Everything works fine ... > > I did not get an NPE but got a "Unresolved compilation problem" instead on > running the program (Adding a main method to your class). This works fine in > 3.6.2 though. > > However, not sure whether this is a bug because even java 7 refuses to run this > class. Accessing the LogLevel class from another class that have the main() would give you the NPE. But I should add that the problem shows up when running the program from inside Eclipse, either as JUnit test or as application. Compiling the stuff with Maven or Ant and running it outside of Eclipse always worked fine. Furthermore the nature of the bug is that there is no code generated WITHOUT any message; the problem will only revealed by running the code. As a workaround, setting "Hiding" to Warning instead of Error would work fine. The patch in bug 346175 fixes this problem. The option to Suppress optional errors is introduced in 3.6 and the problem exists since then. *** This bug has been marked as a duplicate of bug 346175 *** Verified for 3.8 M5 using build I20120123-1300 |