You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "tonihele (via GitHub)" <gi...@apache.org> on 2023/12/14 08:02:41 UTC
Re: [PR] WildFly - ConcurrentHashMap over synchronized collections and some improvements [netbeans]
tonihele commented on code in PR #6602:
URL: https://github.com/apache/netbeans/pull/6602#discussion_r1426367546
##########
enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyDeploymentManager.java:
##########
@@ -83,8 +83,8 @@ public class WildflyDeploymentManager implements DeploymentManager2 {
* server instance bcs instance properties are also removed along with
* instance.
*/
- 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());
Review Comment:
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?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists