Skip to content

Commit

Permalink
Unnecessary unboxing at JsonPrimitive.getAsBoolean() (#2277)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaicolAntali authored Dec 13, 2022
1 parent 0a42c31 commit 6c3cf22
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 @@ -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 6c3cf22

Please sign in to comment.