Skip to content

Commit

Permalink
Update name to StringCaseLocalUsage
Browse files Browse the repository at this point in the history
  • Loading branch information
mlrprananta committed Dec 5, 2022
1 parent f9acde6 commit e5b7b25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@
@AutoService(BugChecker.class)
@BugPattern(
summary = "Specify a `Locale` when calling `String#to{Lower,Upper}Case`",
link = BUG_PATTERNS_BASE_URL + "ImplicitLocaleUsage",
link = BUG_PATTERNS_BASE_URL + "StringCaseLocaleUsage",
linkType = CUSTOM,
severity = WARNING,
tags = FRAGILE_CODE)
public final class ImplicitLocaleUsage extends BugChecker implements MethodInvocationTreeMatcher {
public final class StringCaseLocaleUsage extends BugChecker implements MethodInvocationTreeMatcher {
private static final long serialVersionUID = 1L;
private static final Matcher<ExpressionTree> DEFAULT_LOCALE_CASE_CONVERSION =
instanceMethod()
.onExactClass(String.class.getName())
.namedAnyOf("toLowerCase", "toUpperCase")
.withNoParameters();

/** Instantiates a new {@link ImplicitLocaleUsage} instance. */
public ImplicitLocaleUsage() {}
/** Instantiates a new {@link StringCaseLocaleUsage} instance. */
public StringCaseLocaleUsage() {}

@Override
public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import com.google.errorprone.CompilationTestHelper;
import org.junit.jupiter.api.Test;

final class ImplicitLocaleUsageTest {
final class StringCaseLocaleUsageTest {
private final CompilationTestHelper compilationTestHelper =
CompilationTestHelper.newInstance(ImplicitLocaleUsage.class, getClass());
CompilationTestHelper.newInstance(StringCaseLocaleUsage.class, getClass());
private final BugCheckerRefactoringTestHelper refactoringTestHelper =
newInstance(ImplicitLocaleUsage.class, getClass());
newInstance(StringCaseLocaleUsage.class, getClass());

@Test
void identification() {
Expand Down

0 comments on commit e5b7b25

Please sign in to comment.