cid#1326345 Check of thread-shared field evades lock acquisition

Change-Id: I11fc66358c13c6bb1b6f109980384131b38ef18b
This commit is contained in:
Noel Grandin
2015-10-14 09:33:30 +02:00
parent 1fd4f35f70
commit ec0c4ce0a0

View File

@@ -46,15 +46,12 @@ public class DialogFactory {
// singleton
private DialogFactory(XComponentContext xComponentContext) {
this.xComponentContext = xComponentContext;
factory = this;
}
public static void createDialogFactory(XComponentContext xComponentContext) {
if (factory == null) {
synchronized (DialogFactory.class) {
if (factory == null) {
factory = new DialogFactory(xComponentContext);
}
synchronized (DialogFactory.class) {
if (factory == null) {
factory = new DialogFactory(xComponentContext);
}
}
}
@@ -63,7 +60,6 @@ public class DialogFactory {
if (factory == null) {
throw new java.lang.Exception("DialogFactory not initialized");
}
return factory;
}