pepness commented on code in PR #6596:
URL: https://github.com/apache/netbeans/pull/6596#discussion_r1371979694
##########
enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstance.java:
##########
@@ -180,7 +182,7 @@ public boolean containsValue(Object value) {
@Override
public boolean containsKey(Object key) {
- synchronized(delegate) {return delegate.containsKey(key);}
+ return delegate.computeIfPresent((String) key, (k, v) -> v) !=
null;
}
Review Comment:
I did it because in the old code the method was executed in a `synchronized`
way, the `ConcurrentHashMap` implementation of `containsKey` is not
`synchronized`, the new code will be `synchronized` at a Node level instead of
blocking the entire map.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists