Skip to content

Commit

Permalink
Add clarifying parentheses to a ternary expression. (#2496)
Browse files Browse the repository at this point in the history
The latest Error Prone version issues a warning without the parentheses.
Since we build with `-Werror`, that breaks the build.
  • Loading branch information
eamonnmcmanus authored Sep 23, 2023
1 parent e93fda9 commit edfaf0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gson/src/main/java/com/google/gson/JsonPrimitive.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public boolean equals(Object obj) {
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();
}
Expand Down

0 comments on commit edfaf0c

Please sign in to comment.