commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michele Vivoda (JIRA)" <>
Subject [jira] [Created] (JXPATH-179) Too much synchronization in JXPathIntrospector
Date Mon, 03 Aug 2015 01:07:04 GMT
Michele Vivoda created JXPATH-179:

             Summary: Too much synchronization in JXPathIntrospector
                 Key: JXPATH-179
             Project: Commons JXPath
          Issue Type: Improvement
    Affects Versions: 1.4
            Reporter: Michele Vivoda
            Priority: Minor

The class JXPathIntrospector has been refactored lately to use Collections.synchronizedMap
for the static [byClass] and [byInterface] maps, however access to them in code is still synchronized,
while I believe it should be not since the synchronized-map methods are already locked on
the instance and only one operation is involved. 

I propose to remove the synchronized keyword from the following blocks:

I also dont' see any reason why findInformant() should be synchronized and propose to make
it not synchronized.  Current code does not use any static field so is safe to change and
does not prevent creation of duplicate  JXPathBeanInfo instances that however I believe is
not relevant.

This message was sent by Atlassian JIRA

View raw message