Simplify BagOfPrimitives if statement (#1539)

* Simplify BagOfPrimitives if statement

* formatting
This commit is contained in:
William Collishaw 2019-06-04 12:03:45 -06:00 committed by inder123
parent 49d8630978
commit aa236ec38d

View File

@ -66,25 +66,18 @@ public class BagOfPrimitives {
@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