Skip to content

Commit

Permalink
Unnecessary unboxing at JsonPrimitive.getAsBoolean() (google#2277)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6c3cf22)
  • Loading branch information
MaicolAntali authored and tibor-universe committed Jan 18, 2023
1 parent 61eac8a commit fad3c41
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
Expand Up @@ -104,7 +104,7 @@ public boolean isBoolean() {
@Override
public boolean getAsBoolean() {
if (isBoolean()) {
return ((Boolean) value).booleanValue();
return (Boolean) value;
}
// Check to see if the value as a String is "true" in any case.
return Boolean.parseBoolean(getAsString());
Expand Down

0 comments on commit fad3c41

Please sign in to comment.