Project: JDT
Bug 169446 [quick fix] @SuppressWarnings should use full qualifier to attribute class
Reported: 2007-01-03 11:48:48 | Status: resolved fixed

The quickfix @SuppressWarnings currently only adds an unqualified reference to the SuppressWarnings attribute instead of a fully qualified reference to java.lang.SuppressWarnings. When there is already a reference to another annotation with the same name in the same file, (e.g., edu.umd.cs.findbugs.annotations.SuppressWarnings) then the quickfix references the wrong annotation class. E.g., use the small test file import edu.umd.cs.findbugs.annotations.SuppressWarnings; @SuppressWarnings("BC") public class Test { public static void fromStream(final InputStream stream) throws IOException { List lines = IOUtils.readLines(stream); } } and use the quickfix Add Suppress Warnings then the following attribute is generated: @SuppressWarnings("unchecked") public static void fromStream(final InputStream stream) throws IOException { List lines = IOUtils.readLines(stream); } But, actually the follwing output is correct: @java.lang.SuppressWarnings("unchecked") public static void fromStream(final InputStream stream) throws IOException { List lines = IOUtils.readLines(stream); }

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SuppressWarningsSubProcessor.java