Use Object.equals() where feasible
See gh-31916
This commit is contained in:
committed by
Stéphane Nicoll
parent
a6e87b40c7
commit
72a9864788
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.beans.testfixture.beans;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
@@ -50,7 +52,7 @@ public class Pet {
|
||||
|
||||
final Pet pet = (Pet) o;
|
||||
|
||||
if (name != null ? !name.equals(pet.name) : pet.name != null) {
|
||||
if (!Objects.equals(name, pet.name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user