Unnecessary unboxing at JsonPrimitive.getAsBoolean() (#2277)

This commit is contained in:
Maicol 2022-12-13 18:33:57 +01:00 committed by GitHub
parent 0a42c31efe
commit 6c3cf22435
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ public final class JsonPrimitive extends JsonElement {
@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());