Object.equals()
JAVA-W1080Comparing two primitive values with Objects.equals()
can be inefficient, since both primitives will have to be boxed before being compared.
int someInt = ...;
if (Objects.equals(someInt, 3)) { // unnecessary
// ...
}
Use the ==
operator instead.
if (someInt == 3) {
// ...
}
Object.equals()