Skip to content

Commit 0b2d209

Browse files
author
Luigi R. Viggiano
committed
removed double checking lock
1 parent 11ca019 commit 0b2d209

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

owner/src/main/java/org/aeonbits/owner/loaders/XMLLoader.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,11 @@ public class XMLLoader implements Loader {
3838
private static final long serialVersionUID = -894351666332018767L;
3939
private transient SAXParserFactory factory = null;
4040

41-
private SAXParserFactory factory() {
41+
private synchronized SAXParserFactory factory() {
4242
if (factory == null) {
43-
synchronized (this) {
44-
if (factory == null) {
45-
factory = SAXParserFactory.newInstance();
46-
factory.setValidating(true);
47-
factory.setNamespaceAware(true);
48-
}
49-
}
43+
factory = SAXParserFactory.newInstance();
44+
factory.setValidating(true);
45+
factory.setNamespaceAware(true);
5046
}
5147
return factory;
5248
}

0 commit comments

Comments
 (0)