Community
Participate
Working Groups
Build Identifier: I20100527-1700 I'm using PMD to enhance the quality of my code. When I set the compiler option org.eclipse.jdt.core.compiler.problem.unusedWarningToken from "warning" to "ignore", the warnings don't go away even when I do a clean of the project. After a restart of Eclipse, they are gone (eventually; can't reproduce). When I enable the warnings again, they don't show up. Reproducible: Always Steps to Reproduce: 1. Add @SuppressWarnings({"nls", "PMD.AvoidDuplicateLiterals"}) somewhere in your code. 2. Switch the compiler setting "Java Compiler" / "Errors/Warnings" / "Annotations" / "Unused @SuppressWarnings token:" between "Warning" and "Ignore".
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.