From a0918233030fc5ecc4a1c2350bf71e6775d5d34f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 19 Mar 2018 22:57:46 +0100 Subject: [PATCH] Continued: - Objects.equals() is an overdose here, as a possible null-reference has already been checked before MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- src/org/mxchange/jcountry/model/data/CountryData.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.39.5