cid#1326361 Data race condition
Change-Id: Ia61737232d816bb05f3aedbe76e7905262906a79
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user