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 274a85d2b7..e053959b5a 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 @@ -373,7 +373,7 @@ static final class OptionalOrOtherOptional { @SuppressWarnings({ "LexicographicalAnnotationAttributeListing" /* `key-*` entry must remain last. */, "NestedOptionals" /* This violation will be rewritten. */, - "OptionalOrElse" /* Here `optional2` is a stand-in for expressions that may require computation. */, + "OptionalOrElse" /* Parameters represent expressions that may require computation. */, "key-to-resolve-AnnotationUseStyle-and-TrailingComment-check-conflict" }) Optional before(Optional optional1, Optional optional2) { diff --git a/refaster-support/src/main/java/tech/picnic/errorprone/refaster/matchers/RequiresComputation.java b/refaster-support/src/main/java/tech/picnic/errorprone/refaster/matchers/RequiresComputation.java index e662c72851..f4a7e0777c 100644 --- a/refaster-support/src/main/java/tech/picnic/errorprone/refaster/matchers/RequiresComputation.java +++ b/refaster-support/src/main/java/tech/picnic/errorprone/refaster/matchers/RequiresComputation.java @@ -74,10 +74,6 @@ private static boolean matches(ExpressionTree expressionTree) { return matches(unary.getExpression()); } - if (ASTHelpers.constValue(expressionTree) != null) { - return false; - } - - return true; + return ASTHelpers.constValue(expressionTree) == null; } }