Generating a new equals method in TypeConversionSupport so the proper
null checks exist
This commit is contained in:
Christopher L. Shannon (cshannon) 2016-09-23 08:02:22 -04:00
parent f25e7ab47f
commit 2b99ffcc22
1 changed files with 19 additions and 3 deletions

View File

@ -50,9 +50,25 @@ public final class TypeConversionSupport {
}
@Override
public boolean equals(Object o) {
ConversionKey x = (ConversionKey)o;
return x.from == from && x.to == to;
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ConversionKey other = (ConversionKey) obj;
if (from == null) {
if (other.from != null)
return false;
} else if (!from.equals(other.from))
return false;
if (to == null) {
if (other.to != null)
return false;
} else if (!to.equals(other.to))
return false;
return true;
}
@Override