Skip to content

Commit

Permalink
Add clarifying parentheses to a ternary expression. (google#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 and tibor-universe committed Aug 17, 2024
1 parent efe4d75 commit f7218cb
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 f7218cb

Please sign in to comment.