Re: RFR: JDK-8325255 jdk.internal.util.ReferencedKeySet::add using wrong test [v3]

2024-02-11 Thread ExE Boss
On Tue, 6 Feb 2024 18:43:09 GMT, Jim Laskey wrote: >> Currently, add is returning intern(e) == null which will always be false. >> The correct test is intern(e) == e , that is, true when element is newly >> added. > > Jim Laskey has updated the pull request incrementally with one additional >

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v10]

2024-02-11 Thread ExE Boss
On Mon, 5 Feb 2024 16:59:51 GMT, Jim Laskey wrote: >> ok, `intern(e) == e` is sufficient. > > Created https://bugs.openjdk.org/browse/JDK-8325255 While `intern(e) == e` is (mostly) sufficient, it will return a false positive when `add(e)` is called and `e` is already present in the map, the cor

Re: OpenJDK 17: Loitering AbstractQueuedSynchronizer$ConditionNode instances (also on latest master branch)

2024-02-11 Thread Frank Kretschmer
Hello Core-Libs-Dev team, may I ask you about your opinion about a tiny one-liner change in AbstractQueuedSynchronizer, just as a suggestion how to make ConditionObjects / Nodes even more garbage collector friendly? Checked out https://github.com/openjdk/jdk/blob/jdk-17%2B35/src/java.base/share/

Re: Thoughts on a new method for equality on java.util.Objects?

2024-02-11 Thread David Alayachew
Since I am abandoning this idea, could someone close my JBS ticket? And please link this message in the core-libs-dev archives as the close reason -- I fear the potential for misuse, as mentioned in previous emails on this thread. https://bugs.openjdk.org/browse/JDK-8324718 On Sun, Feb 11, 2024

Withdrawn: 8324718: Add a static function to java.util.Objects to simplify object equality checks

2024-02-11 Thread David Alayachew
On Sat, 27 Jan 2024 03:57:58 GMT, David Alayachew wrote: > Adding a function to Objects in order to facilitate equality checking and > enhance readability. You simply specify the 2 objects that you want to check > for equality, and then provide the functions which will be used to provide > the

Re: Thoughts on a new method for equality on java.util.Objects?

2024-02-11 Thread David Alayachew
Hello, Thank you for your response! So, I had thought of that before posting this email, and mentally, I had hand-waved away the concern by saying that there were plenty of situations where equality would still be useful without hashing. And while I still very much feel the same, the way you phra

Re: Thoughts on a new method for equality on java.util.Objects?

2024-02-11 Thread Holo The Sage Wolf
How beneficial is it to extend equality method without appropriate hashing? Specifically, given you are working in a domain specific world, e.g. projection of Point3D into XY with equality semantics of equalsByXY, Java does not know how to treat semantically equal objects as equal: var foo = new