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
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj) return true;
|
if (this == obj) {
|
||||||
if (obj == null) return false;
|
return true;
|
||||||
if (getClass() != obj.getClass()) return false;
|
}
|
||||||
|
if (obj == null || getClass() != obj.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
JsonPrimitive other = (JsonPrimitive)obj;
|
JsonPrimitive other = (JsonPrimitive)obj;
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
if (other.value != null) return false;
|
return other.value == null;
|
||||||
} else if (!value.equals(other.value)) return false;
|
}
|
||||||
return true;
|
return value.equals(other.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user