- Objects.equals() is an overdose here, as a possible null-reference has
already been checked before
Signed-off-by: Roland Häder <roland@mxchange.org>
@Override
public int compareTo (final Country country) {
- // For performance reasons
+ // Check parameter on null-reference and equality to this
if (null == country) {
// Should not happen
throw new NullPointerException("country is null"); //NOI18N
- } else if (Objects.equals(this, country)) {
+ } else if (country.equals(this)) {
// Same object
return 0;
}