Skip to content
Permalink
Browse files

Simplify BagOfPrimitives if statement (#1539)

* Simplify BagOfPrimitives if statement

* formatting
  • Loading branch information...
WilliamCollishaw authored and inder123 committed Jun 4, 2019
1 parent 49d8630 commit aa236ec38d39f434c1641aeaef9241aec18affde
Showing with 10 additions and 17 deletions.
  1. +10 −17 metrics/src/main/java/com/google/gson/metrics/BagOfPrimitives.java
@@ -66,25 +66,18 @@ public int hashCode() {

@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) return false;
if (getClass() != obj.getClass()) return false;
BagOfPrimitives other = (BagOfPrimitives) obj;
if (booleanValue != other.booleanValue)
return false;
if (intValue != other.intValue)
return false;
if (longValue != other.longValue)
return false;
if (booleanValue != other.booleanValue) return false;
if (intValue != other.intValue) return false;
if (longValue != other.longValue) return false;
if (stringValue == null) {
if (other.stringValue != null)
return false;
} else if (!stringValue.equals(other.stringValue))
return false;
return true;
return other.stringValue == null;
} else {
return stringValue.equals(other.stringValue);
}
}

@Override

0 comments on commit aa236ec

Please sign in to comment.
You can’t perform that action at this time.