JDK-8257598 : Clarify what component values are used in Record::equals
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-12-02
  • Updated: 2021-01-04
  • Resolved: 2020-12-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16 JDK 17
16 b29Fixed 17Fixed
Related Reports
CSR :  
Relates :  
Description
The changes as part of JDK-8256861:

1. Update the JLS to base equality of record classes on the "value of the component field", rather than the value returned by the component accessor.

2. Update the equality of primitives to use the appropriate primitive wrapper `compare` method, rather than the boxing valueOf along with equals.

The specification of java.lang.Record should consider what parts, if any, should be updated to align itself reasonably with the equality definition in the JLS.
Comments
Changeset: b7ac32d6 Author: Vicente Romero <vromero@openjdk.org> Date: 2020-12-11 19:16:34 +0000 URL: https://git.openjdk.java.net/jdk16/commit/b7ac32d6
11-12-2020