Skip to content

Commit

Permalink
Try to work around 1 bogus lgtm.com warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 5, 2021
1 parent 88790c2 commit 469fa03
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@ public class XmlRootNameLookup
* Note: changed to <code>transient</code> for 2.3; no point in serializing such
* state
*/
protected final transient LRUMap<ClassKey,QName> _rootNames = new LRUMap<ClassKey,QName>(40, 200);
protected final transient LRUMap<ClassKey,QName> _rootNames;

public XmlRootNameLookup() { }
public XmlRootNameLookup() {
_rootNames = new LRUMap<ClassKey,QName>(40, 200);
}

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

0 comments on commit 469fa03

Please sign in to comment.