summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-04 12:26:28 (EST)
committerEike Stepper2008-01-04 12:26:28 (EST)
commitbb3bc7904d6cb0d5b7dbcec73bd9fbdac4a0ddeb (patch)
tree4a285d6102575a5d7df9c9f374eaeeabd4f729e7
parentddf45e64c1ba8839e22c5bba62faa57c6e1b34b4 (diff)
downloadcdo-bb3bc7904d6cb0d5b7dbcec73bd9fbdac4a0ddeb.zip
cdo-bb3bc7904d6cb0d5b7dbcec73bd9fbdac4a0ddeb.tar.gz
cdo-bb3bc7904d6cb0d5b7dbcec73bd9fbdac4a0ddeb.tar.bz2
[214370] Fix synchronization in CDOViewImpl.getObject()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=214370
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index 09e15ee..b064523 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -68,7 +68,7 @@ import java.util.concurrent.ConcurrentMap;
* @author Eike Stepper
*/
public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier implements CDOView, CDOIDProvider,
-Adapter.Internal
+ Adapter.Internal
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_VIEW, CDOViewImpl.class);
@@ -266,14 +266,14 @@ Adapter.Internal
public InternalCDOObject getObject(CDOID id, boolean loadOnDemand)
{
- if (id.equals(lastLookupID))
- {
- return lastLookupObject;
- }
-
- lastLookupID = id;
synchronized (objects)
{
+ if (id.equals(lastLookupID))
+ {
+ return lastLookupObject;
+ }
+
+ lastLookupID = id;
lastLookupObject = objects.get(id);
if (lastLookupObject == null)
{
@@ -296,6 +296,7 @@ Adapter.Internal
registerObject(lastLookupObject);
}
}
+
return lastLookupObject;
}