Supporting fully-qualified annotation names.

This commit is contained in:
Travis Schneeberger 2009-03-31 02:06:50 +00:00
parent d868a951ca
commit fdc81723bd
12 changed files with 214 additions and 96 deletions

View File

@ -39,6 +39,19 @@ public final class AnnotationUtility
* Checks to see if the AST is annotated with
* the passed in annotation.
*
* <p>
* This method will not look for imports or package
* statements to detect the passed in annotation.
* </p>
*
* <p>
* 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.
* </p>
*
* @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.
*
* <p>
* This method will not look for imports or package
* statements to detect the passed in annotation.
* </p>
*
* <p>
* 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.
* </p>
*
* @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;
}
}

View File

@ -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);

View File

@ -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");
}

View File

@ -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.

View File

@ -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";
}
};
}
});
}
}

View File

@ -65,3 +65,16 @@ interface Foo5 {
@Deprecated
int bleh();
}
/**
* @deprecated bleh
*/
@java.lang.Deprecated
@interface FullName {
/**
* @deprecated bleh
*/
@java.lang.Deprecated
int bleh();
}

View File

@ -56,3 +56,15 @@ enum Bleh1 {
return "B";
}
}
enum Bleh22 {
B;
/**
* {@inheritDoc}
*/
@java.lang.Override
public String toString() {
return "B";
}
}

View File

@ -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 {

View File

@ -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() {
}

View File

@ -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() {
}

View File

@ -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() {
}

View File

@ -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);