From fdc81723bdfd6af2ffc2c901cd8dd5b2fe948267 Mon Sep 17 00:00:00 2001 From: Travis Schneeberger Date: Tue, 31 Mar 2009 02:06:50 +0000 Subject: [PATCH] Supporting fully-qualified annotation names. --- .../checkstyle/api/AnnotationUtility.java | 32 +++- .../annotation/MissingDeprecatedCheck.java | 6 +- .../annotation/MissingOverrideCheck.java | 6 +- .../annotation/SuppressWarningsCheck.java | 29 ++- .../annotation/GoodAnnonOverride.java | 18 ++ .../checkstyle/annotation/GoodDeprecated.java | 13 ++ .../annotation/GoodOverrideFromObject.java | 12 ++ .../annotation/GoodOverrideFromOther.java | 16 ++ .../annotation/SuppressWarningsCompact.java | 2 +- .../annotation/SuppressWarningsExpanded.java | 2 +- .../annotation/SuppressWarningsSingle.java | 2 +- .../annotation/SuppressWarningsTest.java | 172 +++++++++--------- 12 files changed, 214 insertions(+), 96 deletions(-) diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/api/AnnotationUtility.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/api/AnnotationUtility.java index 7d650b246..996852fc9 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/api/AnnotationUtility.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/api/AnnotationUtility.java @@ -39,6 +39,19 @@ public final class AnnotationUtility * Checks to see if the AST is annotated with * the passed in annotation. * + *

+ * This method will not look for imports or package + * statements to detect the passed in annotation. + *

+ * + *

+ * To check if an AST contains a passed in annotation + * taking into account fully-qualified names + * (ex: java.lang.Override, Override) + * this method will need to be called twice. Once for each + * name given. + *

+ * * @param aAST the current node * @param aAnnotation the annotation name to check for * @return true if contains the annotation @@ -99,6 +112,19 @@ public final class AnnotationUtility * the passed in annotation and return the AST * representing that annotation. * + *

+ * This method will not look for imports or package + * statements to detect the passed in annotation. + *

+ * + *

+ * To check if an AST contains a passed in annotation + * taking into account fully-qualified names + * (ex: java.lang.Override, Override) + * this method will need to be called twice. Once for each + * name given. + *

+ * * @param aAST the current node * @param aAnnotation the annotation name to check for * @return the AST representing that annotation @@ -127,8 +153,10 @@ public final class AnnotationUtility child != null; child = child.getNextSibling()) { if (child.getType() == TokenTypes.ANNOTATION) { - final DetailAST aName = child.findFirstToken(TokenTypes.IDENT); - if (aAnnotation.equals(aName.getText())) { + final DetailAST at = child.getFirstChild(); + final String aName = + FullIdent.createFullIdent(at.getNextSibling()).getText(); + if (aAnnotation.equals(aName)) { return child; } } diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheck.java index 2c0ac1792..e7d561315 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheck.java @@ -76,6 +76,9 @@ public final class MissingDeprecatedCheck extends Check /** {@link Deprecated Deprecated} annotation name */ private static final String DEPRECATED = "Deprecated"; + /** fully-qualified {@link Deprecated Deprecated} annotation name */ + private static final String FQ_DEPRECATED = "java.lang." + DEPRECATED; + /** compiled regexp to match Javadoc tag with no argument * */ private static final Pattern MATCH_DEPRECATED = Utils.createPattern("@(deprecated)\\s+\\S"); @@ -125,7 +128,8 @@ public final class MissingDeprecatedCheck extends Check this.getFileContents().getJavadocBefore(aAST.getLineNo()); final boolean containsAnnotation = - AnnotationUtility.containsAnnotation(aAST, DEPRECATED); + AnnotationUtility.containsAnnotation(aAST, DEPRECATED) + || AnnotationUtility.containsAnnotation(aAST, FQ_DEPRECATED); final boolean containsJavadocTag = this.containsJavadocTag(javadoc); diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java index 887d883b5..41220225b 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java @@ -79,6 +79,9 @@ public final class MissingOverrideCheck extends Check /** {@link Override Override} annotation name */ private static final String OVERRIDE = "Override"; + /** fully-qualified {@link Override Override} annotation name */ + private static final String FQ_OVERRIDE = "java.lang." + OVERRIDE; + /** compiled regexp to match Javadoc tags with no argument and {} * */ private static final Pattern MATCH_INHERITDOC = Utils.createPattern("\\{\\s*@(inheritDoc)\\s*\\}"); @@ -156,7 +159,8 @@ public final class MissingOverrideCheck extends Check } if (containsTag - && !AnnotationUtility.containsAnnotation(aAST, OVERRIDE)) + && (!AnnotationUtility.containsAnnotation(aAST, OVERRIDE) + && !AnnotationUtility.containsAnnotation(aAST, FQ_OVERRIDE))) { this.log(aAST.getLineNo(), "annotation.missing.override"); } diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java index 0ab21b6e5..1f198d171 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java @@ -89,6 +89,13 @@ public class SuppressWarningsCheck extends AbstractFormatCheck /** {@link SuppressWarnings SuppressWarnings} annotation name */ private static final String SUPPRESS_WARNINGS = "SuppressWarnings"; + /** + * fully-qualified {@link SuppressWarnings SuppressWarnings} + * annotation name + */ + private static final String FQ_SUPPRESS_WARNINGS = + "java.lang." + SUPPRESS_WARNINGS; + /** * Ctor that specifies the default for the format property * as specified in the class javadocs. @@ -127,9 +134,7 @@ public class SuppressWarningsCheck extends AbstractFormatCheck @Override public void visitToken(final DetailAST aAST) { - final DetailAST annotation = - AnnotationUtility.getAnnotation( - aAST, SuppressWarningsCheck.SUPPRESS_WARNINGS); + final DetailAST annotation = this.getSuppressWarnings(aAST); if (annotation == null) { return; @@ -174,6 +179,24 @@ public class SuppressWarningsCheck extends AbstractFormatCheck } } + /** + * Gets the {@link SuppressWarnings SuppressWarnings} annotation + * that is annotating the AST. If the annotation does not exist + * this method will return {@code null}. + * + * @param aAST the AST + * @return the {@link SuppressWarnings SuppressWarnings} annotation + */ + private DetailAST getSuppressWarnings(DetailAST aAST) + { + final DetailAST annotation = AnnotationUtility.getAnnotation( + aAST, SuppressWarningsCheck.SUPPRESS_WARNINGS); + + return (annotation != null) ? annotation + : AnnotationUtility.getAnnotation( + aAST, SuppressWarningsCheck.FQ_SUPPRESS_WARNINGS); + } + /** * This method looks for a warning that matches a configured expression. * If found it logs a violation at the given line and column number. diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodAnnonOverride.java b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodAnnonOverride.java index 45d59ce05..8cd6d1f03 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodAnnonOverride.java +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodAnnonOverride.java @@ -35,4 +35,22 @@ public class GoodAnnonOverride } }); } + + void doFoo2(Runnable r) { + doFoo(new Runnable() { + + public void run() { + Throwable t = new Throwable() { + + /** + * {@inheritDoc} + */ + @java.lang.Override + public String toString() { + return "junk"; + } + }; + } + }); + } } diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodDeprecated.java b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodDeprecated.java index 4ffbe0eea..cf187b99e 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodDeprecated.java +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodDeprecated.java @@ -65,3 +65,16 @@ interface Foo5 { @Deprecated int bleh(); } + +/** + * @deprecated bleh + */ +@java.lang.Deprecated +@interface FullName { + + /** + * @deprecated bleh + */ + @java.lang.Deprecated + int bleh(); +} diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodOverrideFromObject.java b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodOverrideFromObject.java index 4d1dffec1..d009540c1 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodOverrideFromObject.java +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodOverrideFromObject.java @@ -56,3 +56,15 @@ enum Bleh1 { return "B"; } } + +enum Bleh22 { + B; + + /** + * {@inheritDoc} + */ + @java.lang.Override + public String toString() { + return "B"; + } +} diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodOverrideFromOther.java b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodOverrideFromOther.java index efed4ff80..e21fbaf67 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodOverrideFromOther.java +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/GoodOverrideFromOther.java @@ -50,6 +50,22 @@ class MoreJunk extends GoodOverrideFromOther { @Override public void doFoo2() { } } + + class EvenMoreMoreJunk extends MoreJunk implements Serializable { + + /** + * {@inheritDoc} + */ + @java.lang.Override + public void doFoo() { + } + + /** + * {@inheritDoc} + */ + @java.lang.Override + public void doFoo2() { } + } } enum Football implements IFoo, IBar { diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsCompact.java b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsCompact.java index 58f15719a..388f1df37 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsCompact.java +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsCompact.java @@ -79,7 +79,7 @@ public class SuppressWarningsCompact } - @SuppressWarnings({(false) ? "unchecked" : ("" == "") ? (false) ? (true) ? "" : "foo" : " " : "unused", (false) ? "unchecked" : ("" == "") ? (false) ? (true) ? "" : "foo" : " " : "unused"}) + @java.lang.SuppressWarnings({(false) ? "unchecked" : ("" == "") ? (false) ? (true) ? "" : "foo" : " " : "unused", (false) ? "unchecked" : ("" == "") ? (false) ? (true) ? "" : "foo" : " " : "unused"}) public void seriously() { } diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsExpanded.java b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsExpanded.java index 8ae2c9509..e0987e358 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsExpanded.java +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsExpanded.java @@ -79,7 +79,7 @@ public class SuppressWarningsExpanded } - @SuppressWarnings(value={(false) ? "unchecked" : ("" == "") ? (false) ? (true) ? "" : "foo" : " " : "unused", (false) ? "unchecked" : ("" == "") ? (false) ? (true) ? "" : "foo" : " " : "unused"}) + @java.lang.SuppressWarnings(value={(false) ? "unchecked" : ("" == "") ? (false) ? (true) ? "" : "foo" : " " : "unused", (false) ? "unchecked" : ("" == "") ? (false) ? (true) ? "" : "foo" : " " : "unused"}) public void seriously() { } diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsSingle.java b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsSingle.java index 236e4e032..16503925a 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsSingle.java +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsSingle.java @@ -79,7 +79,7 @@ public class SuppressWarningsSingle } - @SuppressWarnings((false) ? "unchecked" : ("" == "") ? (false) ? (true) ? "" : "foo" : " " : "unused") + @java.lang.SuppressWarnings((false) ? "unchecked" : ("" == "") ? (false) ? (true) ? "" : "foo" : " " : "unused") public void seriously() { } diff --git a/src/tests/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsTest.java b/src/tests/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsTest.java index afd2de6ac..a60111c42 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsTest.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsTest.java @@ -25,8 +25,8 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "67:37: The warning '' cannot be suppressed at this location.", "72:46: The warning ' ' cannot be suppressed at this location.", "77:60: The warning ' ' cannot be suppressed at this location.", - "82:83: The warning '' cannot be suppressed at this location.", - "82:96: The warning ' ' cannot be suppressed at this location.", + "82:93: The warning '' cannot be suppressed at this location.", + "82:106: The warning ' ' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsSingle.java"), expected); @@ -65,11 +65,11 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "77:37: The warning 'unchecked' cannot be suppressed at this location.", "77:60: The warning ' ' cannot be suppressed at this location.", "77:68: The warning 'unused' cannot be suppressed at this location.", - "82:37: The warning 'unchecked' cannot be suppressed at this location.", - "82:83: The warning '' cannot be suppressed at this location.", - "82:88: The warning 'foo' cannot be suppressed at this location.", - "82:96: The warning ' ' cannot be suppressed at this location.", - "82:105: The warning 'unused' cannot be suppressed at this location.", + "82:47: The warning 'unchecked' cannot be suppressed at this location.", + "82:93: The warning '' cannot be suppressed at this location.", + "82:98: The warning 'foo' cannot be suppressed at this location.", + "82:106: The warning ' ' cannot be suppressed at this location.", + "82:115: The warning 'unused' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsSingle.java"), expected); @@ -94,7 +94,7 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "67:42: The warning 'unchecked' cannot be suppressed at this location.", "72:65: The warning 'unchecked' cannot be suppressed at this location.", "77:37: The warning 'unchecked' cannot be suppressed at this location.", - "82:37: The warning 'unchecked' cannot be suppressed at this location.", + "82:47: The warning 'unchecked' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsSingle.java"), expected); @@ -117,7 +117,7 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "64:33: The warning 'unchecked' cannot be suppressed at this location.", "72:65: The warning 'unchecked' cannot be suppressed at this location.", "77:37: The warning 'unchecked' cannot be suppressed at this location.", - "82:37: The warning 'unchecked' cannot be suppressed at this location.", + "82:47: The warning 'unchecked' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsSingle.java"), expected); @@ -150,8 +150,8 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "72:65: The warning 'unchecked' cannot be suppressed at this location.", "77:37: The warning 'unchecked' cannot be suppressed at this location.", "77:68: The warning 'unused' cannot be suppressed at this location.", - "82:37: The warning 'unchecked' cannot be suppressed at this location.", - "82:105: The warning 'unused' cannot be suppressed at this location.", + "82:47: The warning 'unchecked' cannot be suppressed at this location.", + "82:115: The warning 'unused' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsSingle.java"), expected); @@ -181,8 +181,8 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "72:65: The warning 'unchecked' cannot be suppressed at this location.", "77:37: The warning 'unchecked' cannot be suppressed at this location.", "77:68: The warning 'unused' cannot be suppressed at this location.", - "82:37: The warning 'unchecked' cannot be suppressed at this location.", - "82:105: The warning 'unused' cannot be suppressed at this location.", + "82:47: The warning 'unchecked' cannot be suppressed at this location.", + "82:115: The warning 'unused' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsSingle.java"), expected); @@ -221,11 +221,11 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "77:37: The warning 'unchecked' cannot be suppressed at this location.", "77:60: The warning ' ' cannot be suppressed at this location.", "77:68: The warning 'unused' cannot be suppressed at this location.", - "82:37: The warning 'unchecked' cannot be suppressed at this location.", - "82:83: The warning '' cannot be suppressed at this location.", - "82:88: The warning 'foo' cannot be suppressed at this location.", - "82:96: The warning ' ' cannot be suppressed at this location.", - "82:105: The warning 'unused' cannot be suppressed at this location.", + "82:47: The warning 'unchecked' cannot be suppressed at this location.", + "82:93: The warning '' cannot be suppressed at this location.", + "82:98: The warning 'foo' cannot be suppressed at this location.", + "82:106: The warning ' ' cannot be suppressed at this location.", + "82:115: The warning 'unused' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsSingle.java"), expected); @@ -252,10 +252,10 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "72:47: The warning ' ' cannot be suppressed at this location.", "72:98: The warning ' ' cannot be suppressed at this location.", "77:61: The warning ' ' cannot be suppressed at this location.", - "82:84: The warning '' cannot be suppressed at this location.", - "82:97: The warning ' ' cannot be suppressed at this location.", - "82:171: The warning '' cannot be suppressed at this location.", - "82:184: The warning ' ' cannot be suppressed at this location.", + "82:94: The warning '' cannot be suppressed at this location.", + "82:107: The warning ' ' cannot be suppressed at this location.", + "82:181: The warning '' cannot be suppressed at this location.", + "82:194: The warning ' ' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsCompact.java"), expected); @@ -308,16 +308,16 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "77:61: The warning ' ' cannot be suppressed at this location.", "77:69: The warning 'unused' cannot be suppressed at this location.", - "82:38: The warning 'unchecked' cannot be suppressed at this location.", - "82:84: The warning '' cannot be suppressed at this location.", - "82:89: The warning 'foo' cannot be suppressed at this location.", - "82:97: The warning ' ' cannot be suppressed at this location.", - "82:105: The warning 'unused' cannot be suppressed at this location.", - "82:125: The warning 'unchecked' cannot be suppressed at this location.", - "82:171: The warning '' cannot be suppressed at this location.", - "82:176: The warning 'foo' cannot be suppressed at this location.", - "82:184: The warning ' ' cannot be suppressed at this location.", - "82:192: The warning 'unused' cannot be suppressed at this location.", + "82:48: The warning 'unchecked' cannot be suppressed at this location.", + "82:94: The warning '' cannot be suppressed at this location.", + "82:99: The warning 'foo' cannot be suppressed at this location.", + "82:107: The warning ' ' cannot be suppressed at this location.", + "82:115: The warning 'unused' cannot be suppressed at this location.", + "82:135: The warning 'unchecked' cannot be suppressed at this location.", + "82:181: The warning '' cannot be suppressed at this location.", + "82:186: The warning 'foo' cannot be suppressed at this location.", + "82:194: The warning ' ' cannot be suppressed at this location.", + "82:202: The warning 'unused' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsCompact.java"), expected); @@ -344,8 +344,8 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "72:66: The warning 'unchecked' cannot be suppressed at this location.", "72:117: The warning 'unchecked' cannot be suppressed at this location.", "77:38: The warning 'unchecked' cannot be suppressed at this location.", - "82:38: The warning 'unchecked' cannot be suppressed at this location.", - "82:125: The warning 'unchecked' cannot be suppressed at this location.", + "82:48: The warning 'unchecked' cannot be suppressed at this location.", + "82:135: The warning 'unchecked' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsCompact.java"), expected); @@ -406,10 +406,10 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "77:38: The warning 'unchecked' cannot be suppressed at this location.", "77:69: The warning 'unused' cannot be suppressed at this location.", - "82:38: The warning 'unchecked' cannot be suppressed at this location.", - "82:105: The warning 'unused' cannot be suppressed at this location.", - "82:125: The warning 'unchecked' cannot be suppressed at this location.", - "82:192: The warning 'unused' cannot be suppressed at this location.", + "82:48: The warning 'unchecked' cannot be suppressed at this location.", + "82:115: The warning 'unused' cannot be suppressed at this location.", + "82:135: The warning 'unchecked' cannot be suppressed at this location.", + "82:202: The warning 'unused' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsCompact.java"), expected); @@ -443,10 +443,10 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "72:117: The warning 'unchecked' cannot be suppressed at this location.", "77:38: The warning 'unchecked' cannot be suppressed at this location.", "77:69: The warning 'unused' cannot be suppressed at this location.", - "82:38: The warning 'unchecked' cannot be suppressed at this location.", - "82:105: The warning 'unused' cannot be suppressed at this location.", - "82:125: The warning 'unchecked' cannot be suppressed at this location.", - "82:192: The warning 'unused' cannot be suppressed at this location.", + "82:48: The warning 'unchecked' cannot be suppressed at this location.", + "82:115: The warning 'unused' cannot be suppressed at this location.", + "82:135: The warning 'unchecked' cannot be suppressed at this location.", + "82:202: The warning 'unused' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsCompact.java"), expected); @@ -499,16 +499,16 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "77:61: The warning ' ' cannot be suppressed at this location.", "77:69: The warning 'unused' cannot be suppressed at this location.", - "82:38: The warning 'unchecked' cannot be suppressed at this location.", - "82:84: The warning '' cannot be suppressed at this location.", - "82:89: The warning 'foo' cannot be suppressed at this location.", - "82:97: The warning ' ' cannot be suppressed at this location.", - "82:105: The warning 'unused' cannot be suppressed at this location.", - "82:125: The warning 'unchecked' cannot be suppressed at this location.", - "82:171: The warning '' cannot be suppressed at this location.", - "82:176: The warning 'foo' cannot be suppressed at this location.", - "82:184: The warning ' ' cannot be suppressed at this location.", - "82:192: The warning 'unused' cannot be suppressed at this location.", + "82:48: The warning 'unchecked' cannot be suppressed at this location.", + "82:94: The warning '' cannot be suppressed at this location.", + "82:99: The warning 'foo' cannot be suppressed at this location.", + "82:107: The warning ' ' cannot be suppressed at this location.", + "82:115: The warning 'unused' cannot be suppressed at this location.", + "82:135: The warning 'unchecked' cannot be suppressed at this location.", + "82:181: The warning '' cannot be suppressed at this location.", + "82:186: The warning 'foo' cannot be suppressed at this location.", + "82:194: The warning ' ' cannot be suppressed at this location.", + "82:202: The warning 'unused' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsCompact.java"), expected); @@ -533,10 +533,10 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "72:53: The warning ' ' cannot be suppressed at this location.", "72:104: The warning ' ' cannot be suppressed at this location.", "77:67: The warning ' ' cannot be suppressed at this location.", - "82:90: The warning '' cannot be suppressed at this location.", - "82:103: The warning ' ' cannot be suppressed at this location.", - "82:177: The warning '' cannot be suppressed at this location.", - "82:190: The warning ' ' cannot be suppressed at this location.", + "82:100: The warning '' cannot be suppressed at this location.", + "82:113: The warning ' ' cannot be suppressed at this location.", + "82:187: The warning '' cannot be suppressed at this location.", + "82:200: The warning ' ' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsExpanded.java"), expected); @@ -585,16 +585,16 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "77:44: The warning 'unchecked' cannot be suppressed at this location.", "77:67: The warning ' ' cannot be suppressed at this location.", "77:75: The warning 'unused' cannot be suppressed at this location.", - "82:44: The warning 'unchecked' cannot be suppressed at this location.", - "82:90: The warning '' cannot be suppressed at this location.", - "82:95: The warning 'foo' cannot be suppressed at this location.", - "82:103: The warning ' ' cannot be suppressed at this location.", - "82:111: The warning 'unused' cannot be suppressed at this location.", - "82:131: The warning 'unchecked' cannot be suppressed at this location.", - "82:177: The warning '' cannot be suppressed at this location.", - "82:182: The warning 'foo' cannot be suppressed at this location.", - "82:190: The warning ' ' cannot be suppressed at this location.", - "82:198: The warning 'unused' cannot be suppressed at this location.", + "82:54: The warning 'unchecked' cannot be suppressed at this location.", + "82:100: The warning '' cannot be suppressed at this location.", + "82:105: The warning 'foo' cannot be suppressed at this location.", + "82:113: The warning ' ' cannot be suppressed at this location.", + "82:121: The warning 'unused' cannot be suppressed at this location.", + "82:141: The warning 'unchecked' cannot be suppressed at this location.", + "82:187: The warning '' cannot be suppressed at this location.", + "82:192: The warning 'foo' cannot be suppressed at this location.", + "82:200: The warning ' ' cannot be suppressed at this location.", + "82:208: The warning 'unused' cannot be suppressed at this location.", }; @@ -623,8 +623,8 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "72:72: The warning 'unchecked' cannot be suppressed at this location.", "72:123: The warning 'unchecked' cannot be suppressed at this location.", "77:44: The warning 'unchecked' cannot be suppressed at this location.", - "82:44: The warning 'unchecked' cannot be suppressed at this location.", - "82:131: The warning 'unchecked' cannot be suppressed at this location.", + "82:54: The warning 'unchecked' cannot be suppressed at this location.", + "82:141: The warning 'unchecked' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsExpanded.java"), expected); @@ -680,10 +680,10 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "72:123: The warning 'unchecked' cannot be suppressed at this location.", "77:44: The warning 'unchecked' cannot be suppressed at this location.", "77:75: The warning 'unused' cannot be suppressed at this location.", - "82:44: The warning 'unchecked' cannot be suppressed at this location.", - "82:111: The warning 'unused' cannot be suppressed at this location.", - "82:131: The warning 'unchecked' cannot be suppressed at this location.", - "82:198: The warning 'unused' cannot be suppressed at this location.", + "82:54: The warning 'unchecked' cannot be suppressed at this location.", + "82:121: The warning 'unused' cannot be suppressed at this location.", + "82:141: The warning 'unchecked' cannot be suppressed at this location.", + "82:208: The warning 'unused' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsExpanded.java"), expected); @@ -719,10 +719,10 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "72:123: The warning 'unchecked' cannot be suppressed at this location.", "77:44: The warning 'unchecked' cannot be suppressed at this location.", "77:75: The warning 'unused' cannot be suppressed at this location.", - "82:44: The warning 'unchecked' cannot be suppressed at this location.", - "82:111: The warning 'unused' cannot be suppressed at this location.", - "82:131: The warning 'unchecked' cannot be suppressed at this location.", - "82:198: The warning 'unused' cannot be suppressed at this location.", + "82:54: The warning 'unchecked' cannot be suppressed at this location.", + "82:121: The warning 'unused' cannot be suppressed at this location.", + "82:141: The warning 'unchecked' cannot be suppressed at this location.", + "82:208: The warning 'unused' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsExpanded.java"), expected); @@ -771,16 +771,16 @@ public class SuppressWarningsTest extends BaseCheckTestSupport "77:44: The warning 'unchecked' cannot be suppressed at this location.", "77:67: The warning ' ' cannot be suppressed at this location.", "77:75: The warning 'unused' cannot be suppressed at this location.", - "82:44: The warning 'unchecked' cannot be suppressed at this location.", - "82:90: The warning '' cannot be suppressed at this location.", - "82:95: The warning 'foo' cannot be suppressed at this location.", - "82:103: The warning ' ' cannot be suppressed at this location.", - "82:111: The warning 'unused' cannot be suppressed at this location.", - "82:131: The warning 'unchecked' cannot be suppressed at this location.", - "82:177: The warning '' cannot be suppressed at this location.", - "82:182: The warning 'foo' cannot be suppressed at this location.", - "82:190: The warning ' ' cannot be suppressed at this location.", - "82:198: The warning 'unused' cannot be suppressed at this location.", + "82:54: The warning 'unchecked' cannot be suppressed at this location.", + "82:100: The warning '' cannot be suppressed at this location.", + "82:105: The warning 'foo' cannot be suppressed at this location.", + "82:113: The warning ' ' cannot be suppressed at this location.", + "82:121: The warning 'unused' cannot be suppressed at this location.", + "82:141: The warning 'unchecked' cannot be suppressed at this location.", + "82:187: The warning '' cannot be suppressed at this location.", + "82:192: The warning 'foo' cannot be suppressed at this location.", + "82:200: The warning ' ' cannot be suppressed at this location.", + "82:208: The warning 'unused' cannot be suppressed at this location.", }; verify(checkConfig, getPath("annotation" + File.separator + "SuppressWarningsExpanded.java"), expected);