These checks are not useful, as the fields checked have been verified to
be non-null. Also optimizes AbstractPathArgument.hashCode() by directly
referring to the type -- we assume storing the PathArgument alongside
with the class is not going to be used very often.
Change-Id: Id3f4d67819de8462801823880e482a480843fa1e
Signed-off-by: Robert Varga <rovarga@cisco.com>
@Override
public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((type == null) ? 0 : type.hashCode());
- return result;
+ return type.hashCode();
}
@Override
return false;
}
final AbstractPathArgument<?> other = (AbstractPathArgument<?>) obj;
- if (type == null) {
- if (other.type != null) {
- return false;
- }
- } else if (!type.equals(other.type)) {
- return false;
- }
- return true;
+ return type.equals(other.type);
}
}