Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-03-01 18:01:27 +0000
committerEike Stepper2016-03-01 18:01:27 +0000
commitefcd84c2b5a3a7dc4ee9ccf440eb7c6d3a6a83c7 (patch)
tree96e126bacc04f0492c22219b831d8c53e0e7155d /plugins
parent4f9e22d804c37989ae00ed3cc51680fd75c390fe (diff)
downloadcdo-efcd84c2b5a3a7dc4ee9ccf440eb7c6d3a6a83c7.tar.gz
cdo-efcd84c2b5a3a7dc4ee9ccf440eb7c6d3a6a83c7.tar.xz
cdo-efcd84c2b5a3a7dc4ee9ccf440eb7c6d3a6a83c7.zip
[486458] Provide support for optimized loading and notifying of object units
Add setAutoResourceUnitsEnabled(). https://bugs.eclipse.org/bugs/show_bug.cgi?id=486458
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java10
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java18
2 files changed, 16 insertions, 12 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
index e9319324ca..1a5a55924f 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
@@ -1233,7 +1233,10 @@ public class CDOResourceImpl extends CDOResourceLeafImpl implements CDOResource,
if (!root)
{
InternalCDOView view = cdoView();
- view.resourceLoaded(this, true);
+ if (view != null)
+ {
+ view.resourceLoaded(this, true);
+ }
}
Notification notification = setLoaded(true);
@@ -1543,7 +1546,10 @@ public class CDOResourceImpl extends CDOResourceLeafImpl implements CDOResource,
if (!root)
{
InternalCDOView view = cdoView();
- view.resourceLoaded(this, false);
+ if (view != null)
+ {
+ view.resourceLoaded(this, false);
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
index 182e735e6a..fbbfe8da88 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
@@ -1859,23 +1859,21 @@ public abstract class AbstractCDOView extends CDOCommitHistoryProviderImpl<CDOOb
{
String path = getResourcePath(revision);
URI uri = CDOURIUtil.createResourceURI(this, path);
-
- // Bug 334995: Check if locally there is already a resource with the same URI
ResourceSet resourceSet = getResourceSet();
- CDOResource resource1 = (CDOResource)resourceSet.getResource(uri, false);
- String oldName = null;
- if (resource1 != null && !isReadOnly())
+ // Bug 334995: Check if locally there is already a resource with the same URI
+ CDOResource existingResource = (CDOResource)resourceSet.getResource(uri, false);
+ if (existingResource != null && !isReadOnly())
{
// We have no other option than to change the name of the local resource
- oldName = resource1.getName();
- resource1.setName(oldName + ".renamed");
+ String oldName = existingResource.getName();
+ existingResource.setName(oldName + ".renamed");
+
OM.LOG.warn("URI clash: resource being instantiated had same URI as a resource already present "
- + "locally; local resource was renamed from " + oldName + " to " + resource1.getName());
+ + "locally; local resource was renamed from " + oldName + " to " + existingResource.getName());
}
- CDOResource resource2 = getResource(path, true);
- return resource2;
+ return getResource(path, true);
}
private String getResourcePath(InternalCDORevision revision)

Back to the top