]> git.mxchange.org Git - jcountry-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 19 Mar 2018 21:57:46 +0000 (22:57 +0100)
committerRoland Häder <roland@mxchange.org>
Mon, 19 Mar 2018 23:57:11 +0000 (00:57 +0100)
- 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>
src/org/mxchange/jcountry/model/data/CountryData.java

index 614501fe3fad161fc4f69410e526c0469093b6fd..49b41d3cc291c43a19f3578ca9f944916c0ff3ec 100644 (file)
@@ -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;
                }