diff options
-rw-r--r-- | scripting/java/com/sun/star/script/framework/container/ParcelContainer.java | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java index 68db1cfe964c..ddbd46080198 100644 --- a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java +++ b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java @@ -58,14 +58,14 @@ import java.util.StringTokenizer; */ public class ParcelContainer implements XNameAccess { + protected static XSimpleFileAccess m_xSFA; + protected String language; protected String containerUrl; private Collection<Parcel> parcels = new ArrayList<Parcel>(10); - protected static XSimpleFileAccess m_xSFA; protected XComponentContext m_xCtx; private ParcelContainer parent = null; - private final Collection<ParcelContainer> childContainers = new - ArrayList<ParcelContainer>(10); + private final Collection<ParcelContainer> childContainers = new ArrayList<ParcelContainer>(10); private boolean isPkgContainer = false; /** @@ -276,22 +276,24 @@ public class ParcelContainer implements XNameAccess { return this.containerUrl; } - private synchronized void initSimpleFileAccess() { - if (m_xSFA != null) { - return; - } + private void initSimpleFileAccess() { + synchronized (ParcelContainer.class) { + if (m_xSFA != null) { + return; + } - try { + try { - m_xSFA = UnoRuntime.queryInterface( - XSimpleFileAccess.class, - m_xCtx.getServiceManager().createInstanceWithContext( - "com.sun.star.ucb.SimpleFileAccess", m_xCtx)); + m_xSFA = UnoRuntime.queryInterface( + XSimpleFileAccess.class, + m_xCtx.getServiceManager().createInstanceWithContext( + "com.sun.star.ucb.SimpleFileAccess", m_xCtx)); - } catch (Exception e) { - // TODO should throw - LogUtils.DEBUG("Error instantiating simplefile access "); - LogUtils.DEBUG(LogUtils.getTrace(e)); + } catch (Exception e) { + // TODO should throw + LogUtils.DEBUG("Error instantiating simplefile access "); + LogUtils.DEBUG(LogUtils.getTrace(e)); + } } } |