[
https://issues.apache.org/jira/browse/JXPATH-179?focusedWorklogId=235980&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-235980
]
ASF GitHub Bot logged work on JXPATH-179:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 01/May/19 20:42
Start Date: 01/May/19 20:42
Worklog Time Spent: 10m
Work Description: markt-asf commented on pull request #12: JXPATH-179
Removed synch not necessary
URL: https://github.com/apache/commons-jxpath/pull/12
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 235980)
Time Spent: 10m
Remaining Estimate: 50m (was: 1h)
> Too much synchronization in JXPathIntrospector
> ----------------------------------------------
>
> Key: JXPATH-179
> URL: https://issues.apache.org/jira/browse/JXPATH-179
> Project: Commons JXPath
> Issue Type: Improvement
> Affects Versions: 1.4
> Reporter: Michele Vivoda
> Priority: Minor
> Labels: synchronized, thread-safety
> Original Estimate: 1h
> Time Spent: 10m
> Remaining Estimate: 50m
>
> 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:
> https://github.com/apache/commons-jxpath/blob/trunk/src/java/org/apache/commons/jxpath/JXPathIntrospector.java#L71
> https://github.com/apache/commons-jxpath/blob/trunk/src/java/org/apache/commons/jxpath/JXPathIntrospector.java#L89
> https://github.com/apache/commons-jxpath/blob/trunk/src/java/org/apache/commons/jxpath/JXPathIntrospector.java#L94
> https://github.com/apache/commons-jxpath/blob/trunk/src/java/org/apache/commons/jxpath/JXPathIntrospector.java#L125
> 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.
> https://github.com/apache/commons-jxpath/blob/trunk/src/java/org/apache/commons/jxpath/JXPathIntrospector.java#L177
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)