Summary: | Switching unusedWarningToken has no immediate effect | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Aaron Digulla <digulla> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | VERIFIED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | daniel_megert, Olivier_Thomann |
Version: | 3.6 | ||
Target Milestone: | 3.7 M1 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
Aaron Digulla
2010-06-06 15:46:47 EDT
It works for built-in categories (e.g. "nls"). Could be a problem of the PMD compiler participant or annotation processor. Moving to JDT Core for comment. Please describe how to setup an environment to reproduce this issue. ... PEBKAC But since I wrote it, here is how to do it: 1. Download Eclipse 3.6RC4 (http://download.eclipse.org/eclipse/downloads/drops/S-3.6RC4-201006031500/index.php) 2. Install the PMD plugin from http://pmd.sourceforge.net/integrations.html#eclipse (Update site: http://pmd.sf.net/eclipse ) 3. Create a new project 4. Enable PMD in the project properties. 5. In the compiler options for the project, enable "Enable project specific settings" and then, under "Code Style", change "Non-externalized strings" (last option) to "Warning". 6. Paste this code into the project: ---------------- cut here ---------------------- package demo; public class Demo { public String test () throws Exception { return "xxx"; } } ---------------- cut here ---------------------- You should get two warnings. 7. Go to the "xxx" and select "Add @SuppressWarnings 'nls' to 'test()'" from the quick fix menu 8. Change the @SuppressWarnings to @SuppressWarnings({"nls", "PMD"}) 9. Now one warning should be left: Unsupported @SuppressWarnings("PMD") 10. Open the compiler options again and open the "Annotations" group. Set "Unhandled token in '@SuppressWarnings'" to "Ignore". 11. Click OK to recompile ... damn :-( Resolution: I probably mixed up "Unhandled token" and "Unused token". Verified. Verified. |