Skip to content

Commit 469fa03

Browse files
committed
Try to work around 1 bogus lgtm.com warning
1 parent 88790c2 commit 469fa03

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/com/fasterxml/jackson/dataformat/xml/util/XmlRootNameLookup.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,17 @@ public class XmlRootNameLookup
3131
* Note: changed to <code>transient</code> for 2.3; no point in serializing such
3232
* state
3333
*/
34-
protected final transient LRUMap<ClassKey,QName> _rootNames = new LRUMap<ClassKey,QName>(40, 200);
34+
protected final transient LRUMap<ClassKey,QName> _rootNames;
3535

36-
public XmlRootNameLookup() { }
36+
public XmlRootNameLookup() {
37+
_rootNames = new LRUMap<ClassKey,QName>(40, 200);
38+
}
3739

3840
protected Object readResolve() {
3941
// just need to make 100% sure it gets set to non-null, that's all
42+
// 05-Jan-2020, tatu: How is that possibly, you ask? JDK serialization, that's how
43+
// (it by-passes calls to constructors, as well as initializers)
44+
// ... and if you don't believe, try commenting it out and see test failure you get
4045
if (_rootNames == null) {
4146
return new XmlRootNameLookup();
4247
}

0 commit comments

Comments
 (0)