Skip to content

Commit

Permalink
CLDR-14460 XPathParts remove synchronized block (#995)
Browse files Browse the repository at this point in the history
  • Loading branch information
srl295 committed Feb 1, 2021
1 parent feb602b commit caf9628
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1293,12 +1293,9 @@ public XPathParts cloneAsThawed() {
return xppClone;
}

public static synchronized XPathParts getFrozenInstance(String path) {
XPathParts result = cache.get(path);
if (result == null) {
result = new XPathParts().addInternal(path, true).freeze();
cache.put(path, result);
}
public static XPathParts getFrozenInstance(String path) {
XPathParts result = cache.computeIfAbsent(path,
(String forPath) -> new XPathParts().addInternal(forPath, true).freeze());
return result;
}

Expand Down

0 comments on commit caf9628

Please sign in to comment.