From edfaf0c387cd0dc42403f8994c3ef4722d2898a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89amonn=20McManus?= Date: Fri, 22 Sep 2023 17:43:14 -0700 Subject: [PATCH] Add clarifying parentheses to a ternary expression. (#2496) The latest Error Prone version issues a warning without the parentheses. Since we build with `-Werror`, that breaks the build. --- gson/src/main/java/com/google/gson/JsonPrimitive.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gson/src/main/java/com/google/gson/JsonPrimitive.java b/gson/src/main/java/com/google/gson/JsonPrimitive.java index 827de959..7095c05a 100644 --- a/gson/src/main/java/com/google/gson/JsonPrimitive.java +++ b/gson/src/main/java/com/google/gson/JsonPrimitive.java @@ -285,7 +285,7 @@ public final class JsonPrimitive extends JsonElement { return other.value == null; } if (isIntegral(this) && isIntegral(other)) { - return this.value instanceof BigInteger || other.value instanceof BigInteger + return (this.value instanceof BigInteger || other.value instanceof BigInteger) ? this.getAsBigInteger().equals(other.getAsBigInteger()) : this.getAsNumber().longValue() == other.getAsNumber().longValue(); }