Fixed indentation and simplified equals method as per code review comments on r419
This commit is contained in:
parent
f4f596ec3d
commit
c13fc568c7
@ -351,13 +351,16 @@ public final class JsonPrimitive extends JsonElement {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
if (obj == null) return false;
|
||||
if (getClass() != obj.getClass()) return false;
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
JsonPrimitive other = (JsonPrimitive)obj;
|
||||
if (value == null) {
|
||||
if (other.value != null) return false;
|
||||
} else if (!value.equals(other.value)) return false;
|
||||
return true;
|
||||
return other.value == null;
|
||||
}
|
||||
return value.equals(other.value);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user