- 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 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;
}
@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;
}