]> git.mxchange.org Git - jaddressbook-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 19 Mar 2018 21:49:18 +0000 (22:49 +0100)
committerRoland Häder <roland@mxchange.org>
Mon, 19 Mar 2018 21:49:18 +0000 (22:49 +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/jaddressbook/model/addressbook/UserAddressbook.java
src/org/mxchange/jaddressbook/model/addressbook/entry/UserAddressbookEntry.java

index 2fa1ea56588b06c2a973e0ec8f20c451b4d2f546..f6766a80086c39c78d087993a85e6c3828551a29 100644 (file)
@@ -139,11 +139,11 @@ public class UserAddressbook implements Addressbook {
 
        @Override
        public int compareTo (final Addressbook addressbook) {
-               // Checkparameter and return 0 if equal
+               // Check parameter and return 0 if equal
                if (null == addressbook) {
                        // Should not happen
                        throw new NullPointerException("addressbook is null"); //NOI18N
-               } else if (Objects.equals(this, addressbook)) {
+               } else if (addressbook.equals(this)) {
                        // Same object
                        return 0;
                }
index beddfa9463cec616e2b28f250caa480c698bde32..6e42ca40b73c649047aef26ef13c385751684ca8 100644 (file)
@@ -101,11 +101,11 @@ public class UserAddressbookEntry implements AddressbookEntry {
 
        @Override
        public int compareTo (final AddressbookEntry addressbookEntry) {
-               // For performance reasons
+               // Parameter should not be NULL
                if (null == addressbookEntry) {
                        // Should not happen
                        throw new NullPointerException("addressbookEntry is null"); //NOI18N
-               } else if (Objects.equals(this, addressbookEntry)) {
+               } else if (addressbookEntry.equals(this)) {
                        // Same object
                        return 0;
                }