mirror of
https://github.com/jlengrand/error-prone-support.git
synced 2026-03-10 08:11:25 +00:00
Some tweaks
This commit is contained in:
@@ -44,7 +44,7 @@ import java.util.stream.Stream;
|
||||
public final class LexicographicalAnnotationAttributeListingCheck extends BugChecker
|
||||
implements AnnotationTreeMatcher {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final String FLAG_PREFIX = "LexicographicalAnnotationAttributeListingCheck:";
|
||||
private static final String FLAG_PREFIX = "LexicographicalAnnotationAttributeListing:";
|
||||
private static final String INCLUDED_ANNOTATIONS_FLAG = FLAG_PREFIX + "Includes";
|
||||
private static final String EXCLUDED_ANNOTATIONS_FLAG = FLAG_PREFIX + "Excludes";
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ import java.util.regex.Pattern;
|
||||
public final class RedundantStringConversionCheck extends BugChecker
|
||||
implements BinaryTreeMatcher, CompoundAssignmentTreeMatcher, MethodInvocationTreeMatcher {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final String FLAG_PREFIX = "RedundantStringConversionCheck:";
|
||||
private static final String FLAG_PREFIX = "RedundantStringConversion:";
|
||||
private static final String EXTRA_STRING_CONVERSION_METHODS_FLAG =
|
||||
FLAG_PREFIX + "ExtraConversionMethods";
|
||||
private static final Matcher<ExpressionTree> ANY_EXPR = (t, s) -> true;
|
||||
|
||||
@@ -18,8 +18,8 @@ public final class LexicographicalAnnotationAttributeListingCheckTest {
|
||||
LexicographicalAnnotationAttributeListingCheck.class, getClass())
|
||||
.setArgs(
|
||||
ImmutableList.of(
|
||||
"-XepOpt:LexicographicalAnnotationAttributeListingCheck:Includes=pkg.A.Foo,pkg.A.Bar",
|
||||
"-XepOpt:LexicographicalAnnotationAttributeListingCheck:Excludes=pkg.A.Bar#value"));
|
||||
"-XepOpt:LexicographicalAnnotationAttributeListing:Includes=pkg.A.Foo,pkg.A.Bar",
|
||||
"-XepOpt:LexicographicalAnnotationAttributeListing:Excludes=pkg.A.Bar#value"));
|
||||
private final BugCheckerRefactoringTestHelper refactoringTestHelper =
|
||||
BugCheckerRefactoringTestHelper.newInstance(
|
||||
new LexicographicalAnnotationAttributeListingCheck(), getClass());
|
||||
|
||||
@@ -19,7 +19,7 @@ public final class RedundantStringConversionCheckTest {
|
||||
CompilationTestHelper.newInstance(RedundantStringConversionCheck.class, getClass())
|
||||
.setArgs(
|
||||
ImmutableList.of(
|
||||
"-XepOpt:RedundantStringConversionCheck:ExtraConversionMethods=java.lang.Enum#name(),A#name(),A.B#toString(int)"));
|
||||
"-XepOpt:RedundantStringConversion:ExtraConversionMethods=java.lang.Enum#name(),A#name(),A.B#toString(int)"));
|
||||
private final BugCheckerRefactoringTestHelper refactoringTestHelper =
|
||||
BugCheckerRefactoringTestHelper.newInstance(new RedundantStringConversionCheck(), getClass());
|
||||
|
||||
@@ -412,6 +412,14 @@ public final class RedundantStringConversionCheckTest {
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" enum E {",
|
||||
" ELEM;",
|
||||
"",
|
||||
" public String toString() {",
|
||||
" return \"__\" + name() + \"__\";",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" private final B b = new B();",
|
||||
" private final String s = b.toString();",
|
||||
"",
|
||||
|
||||
Reference in New Issue
Block a user