provide human message for SuppressWarningsHolder, #1158

This commit is contained in:
Vladislav Lisetskiy 2015-07-01 18:26:09 +03:00 committed by Roman Ivanov
parent 0ff261c5ac
commit 5844ab2d34
2 changed files with 10 additions and 1 deletions

View File

@ -40,6 +40,13 @@ import java.util.Map;
*/
public class SuppressWarningsHolder
extends Check {
/**
* A key is pointing to the warning message text in "messages.properties"
* file.
*/
public static final String MSG_KEY = "suppress.warnings.invalid.target";
/**
* Optional prefix for warning suppressions that are only intended to be
* recognized by checkstyle. For instance, to suppress {@code
@ -244,7 +251,7 @@ public class SuppressWarningsHolder
if (targetAST == null) {
log(ast, "suppress.warnings.invalid.target");
log(ast.getLineNo(), MSG_KEY);
return;
}

View File

@ -28,3 +28,5 @@ properties.duplicateproperty=Duplicated property ''{0}'' ({1} occurrence(s)).
unable.open.cause=Unable to open ''{0}'': {1}.
forbid.escaped.unicode.char=Unicode escape(s) usage should be avoided.
suppress.warnings.invalid.target=Invalid target for @SuppressWarnings.