The `java.util.Objects.equals` experiment to reduce identity comparisons for value objects in Valhalla exposed a potential compatibility issue with implementations of application .equals methods.
Since it was added in 1.7, `Objects.equals(a, b)` has included an identity comparison before invoking the .equals method.
That comparison can obscure the behavior of the .equals method in which it does not return true when comparing an object with itself.
The change is reverted to avoid possible compatibility issues that might occur without further investigation or notice.
Since it was added in 1.7, `Objects.equals(a, b)` has included an identity comparison before invoking the .equals method.
That comparison can obscure the behavior of the .equals method in which it does not return true when comparing an object with itself.
The change is reverted to avoid possible compatibility issues that might occur without further investigation or notice.
- relates to
-
JDK-8366841 [lworld] Objects.equals without identity comparison
-
- Resolved
-
-
JDK-8371497 Simplify java.util.Object.equals - remove the identity comparison
-
- Open
-