From: Roland Häder Date: Mon, 19 Mar 2018 21:57:46 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a0918233030fc5ecc4a1c2350bf71e6775d5d34f;p=jcountry-core.git Continued: - Objects.equals() is an overdose here, as a possible null-reference has already been checked before Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jcountry/model/data/CountryData.java b/src/org/mxchange/jcountry/model/data/CountryData.java index 614501f..49b41d3 100644 --- a/src/org/mxchange/jcountry/model/data/CountryData.java +++ b/src/org/mxchange/jcountry/model/data/CountryData.java @@ -119,11 +119,11 @@ public class CountryData implements Country { @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; }