RFR: 8309751: Duplicate constant pool entries added during default method processing [v2]
Coleen Phillimore
coleenp at openjdk.org
Mon Apr 8 14:23:01 UTC 2024
On Mon, 8 Apr 2024 06:57:32 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> https://bugs.openjdk.org/browse/JDK-8329818 - HotSpot Style Guide should explicitly permit the "union trick"
>
> Thanks @kimbarrett . I didn't recognise this code as "the union trick" as such, but it is - we use the `value` member to access the bit pattern of the real (primitive) value for hashing purposes. Certainly should be safe/harmless for the types involved.
It's used for hashing and for equals comparison. I wouldn't want to change one without the other.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18548#discussion_r1555927968
More information about the hotspot-runtime-dev
mailing list