-
Notifications
You must be signed in to change notification settings - Fork 874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WildFly - ConcurrentHashMap over synchronized collections and some improvements #6602
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sane to me.
@@ -21,7 +21,8 @@ auxiliary.de-markiewb-netbeans-plugins-eclipse-formatter.eclipseFormatterLocatio | |||
auxiliary.de-markiewb-netbeans-plugins-eclipse-formatter.enableFormatAsSaveAction=false | |||
auxiliary.de-markiewb-netbeans-plugins-eclipse-formatter.showNotifications=true | |||
auxiliary.de-markiewb-netbeans-plugins-eclipse-formatter.useProjectSettings=false | |||
javac.source=1.8 | |||
javac.source=11 | |||
javac.target=11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed? From my POV we should keep changes to javac.*
to a minimum and only bump when needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not needed. Reverting and then merging.
- Add Java 21 support for Wildfly 30+ - Prefer ConcurrentMap to synchronizedMap - Prefer ConcurrentHashMap.newKeySet to synchronizedSet - Remove synchronized blocks when using atomic and concurrent operations with ConcurrentHashMap - Set initial capacity for profile sets - Use try-with-resources when possible
private static final Map<InstanceProperties, Boolean> PROPERTIES_TO_IS_RUNNING | ||
= Collections.synchronizedMap(new WeakHashMap()); | ||
private static final ConcurrentMap<InstanceProperties, Boolean> PROPERTIES_TO_IS_RUNNING | ||
= new ConcurrentHashMap(new WeakHashMap()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, isn't this very different than the original?
new ConcurrentHashMap(new WeakHashMap()) -> just creates a new ConcurrentHashMap, giving new WeakHashMap (empty map) as a parameter does nothing.
Collections.synchronizedMap(new WeakHashMap()) actually creates a synchronized version of WeakHashMap.
If ConcurrentHashMap is used, one must change the usage so that the keys inserted in the map are weak references. IF the original behavior is wanted. Right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right - would you be willing to create a PR for your suggested fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right - would you be willing to create a PR for your suggested fix?
I think it is faster if you guys do it. You can choose the preferred implementation also :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #6872
NetBeans Module Notes:
ConcurrentMap
tosynchronizedMap
ConcurrentHashMap.newKeySet
tosynchronizedSet
with
ConcurrentHashMap
try-with-resources
when possiblesource
andtarget
to version 11 (will revert if tests are red)Testing:
ant verify-libs-and-licenses
ant check-sigtests-release
ant -Dcluster.config=release commit-validation
WildFly 30 Release Notes