diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-14 09:33:30 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-14 09:55:16 +0200 |
commit | ec0c4ce0a02ed72459de1fcaf3f2f7713bf67b5d (patch) | |
tree | 648e3616a87108cf412f01db523b883cd4426a07 /scripting/java | |
parent | 1fd4f35f70fbb740e05200b9591d1e6d0dd5637e (diff) |
cid#1326345 Check of thread-shared field evades lock acquisition
Change-Id: I11fc66358c13c6bb1b6f109980384131b38ef18b
Diffstat (limited to 'scripting/java')
-rw-r--r-- | scripting/java/com/sun/star/script/framework/browse/DialogFactory.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java b/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java index 303b600e2e3b..08cfba4c8e8b 100644 --- a/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java +++ b/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java @@ -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; } |