Closed magicprinc closed 1 year ago
Better to use ConcurrentHashMap.newKeySet
You're welcome to contribute a PR for this, as well as in the impacted projects:
I would like to, but I still have failed tests when I build vert.x-core locally on my Windows10/JDK17. So I am not ready yet... :-(
BTW, I would enjoy if you find my other PR useful: https://github.com/eclipse-vertx/vert.x/pull/4844 https://github.com/eclipse-vertx/vert.x/pull/4847 https://github.com/eclipse-vertx/vert.x/pull/4850
They have more benefits than ConcurrentHashSet removial.
If you don't mind, i can do this too:), @magicprinc ,a nice find!
@tsegismont Anyway. Without tests :-) https://github.com/eclipse-vertx/vert.x/pull/4852
@He-Pin Could you test it? And add test for concurrentHashSet implementations too?
1) I have replaced method with its body. 2) Fix in vertx-service-discovery: https://github.com/vert-x3/vertx-service-discovery/pull/172 3) Fix in vertx-mqtt: https://github.com/vert-x3/vertx-mqtt/pull/243
@tsegismont All your tasks are done!
@magicprinc there's one more usage in vertx-mqtt, can you please take care of it before we merge this PR?
@tsegismont I am sorry, but I can't find it. Could you name a class with it? /
GitHub search shows 2 files, and both are fixed in my PR https://github.com/vert-x3/vertx-mqtt/pull/243
@tsegismont They are both fixed in PR https://github.com/vert-x3/vertx-mqtt/pull/243 Have you seen this PR?
For some reason, I wasn't subscribed to all notifications on vertx-mqtt
This is why I missed the PR, sorry.
Closed by #4852
It seems that
io.vertx.core.impl.ConcurrentHashSet
is a copy of JDK'sCollections.newSetFromMap
. The Best Code is No Code At All. It is probably a good idea to review and replace this class with two utility methods:PR: https://github.com/eclipse-vertx/vert.x/pull/4852