Skip to content

Commit

Permalink
Merge branch '2.18'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Mar 27, 2024
2 parents 926d7b1 + 7e50d5b commit b521c41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
3 changes: 2 additions & 1 deletion release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Project: jackson-dataformat-xml

2.18.0 (not yet released)

No changes since 2.17
- Remove unnecessary synchronization around `LRUMap` in `XmlRootNameLookup`
(contributed by @pjfanning)

2.17.1 (not yet released)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public class XmlRootNameLookup
/**
* For efficient operation, let's try to minimize number of times we
* need to introspect root element name to use.
*<p>
* Note: changed to <code>transient</code> for 2.3; no point in serializing such
* state
*/
protected final transient SimpleLookupCache<ClassKey,QName> _rootNames;

Expand All @@ -54,17 +51,12 @@ public QName findRootName(DatabindContext ctxt, JavaType rootType) {
public QName findRootName(DatabindContext ctxt, Class<?> rootType)
{
ClassKey key = new ClassKey(rootType);
QName name;
synchronized (_rootNames) {
name = _rootNames.get(key);
}
QName name = _rootNames.get(key);
if (name != null) {
return name;
}
name = _findRootName(ctxt, rootType);
synchronized (_rootNames) {
_rootNames.put(key, name);
}
_rootNames.put(key, name);
return name;
}

Expand Down

0 comments on commit b521c41

Please sign in to comment.