diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/OptionalRules.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/OptionalRules.java index 95ad4ca5d45..a8eb97b4529 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/OptionalRules.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/OptionalRules.java @@ -101,7 +101,7 @@ Function, T> after() { } /** Prefer {@link Optional#equals(Object)} over more contrived alternatives. */ - static final class OptionalHasValue { + static final class OptionalEqualsOptional { @BeforeTemplate boolean before(Optional optional, S value) { return Refaster.anyOf( @@ -454,5 +454,5 @@ Stream after(Optional optional) { // XXX: Add a rule for: // `optional.flatMap(x -> pred(x) ? Optional.empty() : Optional.of(x))` and variants. - // (Maybe canonicalize the inner expression. Maybe we rewrite already.) + // (Maybe canonicalize the inner expression. Maybe we rewrite it already.) } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestInput.java index 841a1834211..c09719bea5d 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestInput.java @@ -35,7 +35,7 @@ Function, Integer> testOptionalOrElseThrowMethodReference() { return Optional::get; } - ImmutableSet testOptionalHasValue() { + ImmutableSet testOptionalEqualsOptional() { return ImmutableSet.of( Optional.of("foo").filter("bar"::equals).isPresent(), Optional.of("baz").stream().anyMatch("qux"::equals)); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestOutput.java index cb3d9c194ef..88815292474 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/OptionalRulesTestOutput.java @@ -35,7 +35,7 @@ Function, Integer> testOptionalOrElseThrowMethodReference() { return Optional::orElseThrow; } - ImmutableSet testOptionalHasValue() { + ImmutableSet testOptionalEqualsOptional() { return ImmutableSet.of( Optional.of("foo").equals(Optional.of("bar")), Optional.of("baz").equals(Optional.of("qux")));