From 48f973b70fc3e10feb35beeb5efcb9b6040d840f Mon Sep 17 00:00:00 2001 From: mlrprananta Date: Fri, 7 Apr 2023 15:58:09 +0200 Subject: [PATCH] Suggestions --- .../tech/picnic/errorprone/refasterrules/OptionalRules.java | 2 +- .../picnic/errorprone/refasterrules/OptionalRulesTestInput.java | 2 +- .../errorprone/refasterrules/OptionalRulesTestOutput.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 51b9eaf0e78..70f99e3aa24 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 @@ -228,7 +228,7 @@ T after(Optional o1, Optional o2) { * value is a method invocation with two or more arguments. */ // XXX: Extend rule to all method invocations (with less than 2 arguments). - static final class OrElseToOrElseGet { + static final class OptionalOrElseGet { @BeforeTemplate T before(Optional o, @Matches(IsMethodInvocationWithTwoOrMoreArgs.class) T value) { return o.orElse(value); 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 060aadb7f41..99a99c0b806 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 @@ -120,7 +120,7 @@ Optional testOptionalMap() { return Optional.of(1).stream().map(String::valueOf).findAny(); } - ImmutableSet testOrElseToOrElseGet() { + ImmutableSet testOptionalOrElseGet() { return ImmutableSet.of( Optional.of("foo").orElse("bar"), Optional.of("foo").orElse(toString()), 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 b7f496b1da7..6ff163f7652 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 @@ -113,7 +113,7 @@ Optional testOptionalMap() { return Optional.of(1).map(String::valueOf); } - ImmutableSet testOrElseToOrElseGet() { + ImmutableSet testOptionalOrElseGet() { return ImmutableSet.of( Optional.of("foo").orElse("bar"), Optional.of("foo").orElse(toString()),