Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java207
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionResolverImpl.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContextImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/AbstractSyncRevisionsIndication.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LockObjectsIndication.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SyncRevisionsIndication.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/net4j/org/eclipse/net4j/tests/TestEMFUtil.java229
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsAllConfigs.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFTest.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_273565_Test.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_273758_Test.java89
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ExportResourceAction.java30
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/AbstractSyncRevisionsRequest.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDORevisionManagerImpl.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java1
21 files changed, 409 insertions, 197 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java
index 2e0e50d6a6..ec939d5c1e 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java
@@ -7,18 +7,16 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
- * Victor Roldan Betancort - http://bugs.eclipse.org/244801
+ * Victor Roldan Betancort - maintenance
* Simon McDuff - maintenance
*/
package org.eclipse.emf.cdo.common.model;
import org.eclipse.net4j.util.WrappedException;
-import org.eclipse.net4j.util.io.IORuntimeException;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
@@ -29,21 +27,16 @@ import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EcoreFactory;
import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.EPackage.Registry;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
-import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
@@ -77,21 +70,6 @@ public final class EMFUtil
return array;
}
- public static void registerPackage(EPackage ePackage, EPackage.Registry... packageRegistries)
- {
- ePackage.getClass(); // Initialize package in standalone mode
- if (packageRegistries == null || packageRegistries.length == 0)
- {
- EPackage.Registry[] globalRegistry = { EPackage.Registry.INSTANCE };
- packageRegistries = globalRegistry;
- }
-
- for (EPackage.Registry packageRegistry : packageRegistries)
- {
- packageRegistry.put(ePackage.getNsURI(), ePackage);
- }
- }
-
public static EClassifier getClassifier(EPackage ePackage, int classifierID)
{
EList<EClassifier> classifiers = ePackage.getEClassifiers();
@@ -106,13 +84,6 @@ public final class EMFUtil
return null;
}
- public static String getParentURI(EPackage ePackage)
- {
- EPackage superPackage = ePackage.getESuperPackage();
- String parentURI = superPackage == null ? null : superPackage.getNsURI();
- return parentURI;
- }
-
public static EPackage getTopLevelPackage(EPackage ePackage)
{
EPackage superPackage = ePackage.getESuperPackage();
@@ -171,138 +142,6 @@ public final class EMFUtil
return eReference;
}
- public static ResourceSet newResourceSet(Resource.Factory resourceFactory)
- {
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", resourceFactory); //$NON-NLS-1$
- return resourceSet;
- }
-
- public static ResourceSet newXMIResourceSet(EPackage... ePackages)
- {
- ResourceSet resourceSet = newResourceSet(new XMIResourceFactoryImpl());
- if (ePackages != null && ePackages.length != 0)
- {
- Registry packageRegistry = resourceSet.getPackageRegistry();
- for (EPackage ePackage : ePackages)
- {
- packageRegistry.put(ePackage.getNsURI(), ePackage);
- }
- }
-
- return resourceSet;
- }
-
- public static ResourceSet newEcoreResourceSet(EPackage.Registry packageRegistry)
- {
- ResourceSet resourceSet = newResourceSet(new EcoreResourceFactoryImpl());
- resourceSet.setPackageRegistry(packageRegistry);
- return resourceSet;
- }
-
- public static ResourceSet newEcoreResourceSet()
- {
- return newEcoreResourceSet(EPackage.Registry.INSTANCE);
- }
-
- public static EObject load(String fileName, ResourceSet resourceSet)
- {
- Resource resource = resourceSet.getResource(URI.createFileURI(fileName), true);
- return resource.getContents().get(0);
- }
-
- public static EObject loadXMI(String fileName, EPackage... ePackages)
- {
- ResourceSet resourceSet = newXMIResourceSet(ePackages);
- return load(fileName, resourceSet);
- }
-
- public static EObject loadXMI(String fileName, EPackage.Registry packageRegistry)
- {
- ResourceSet resourceSet = newXMIResourceSet();
- resourceSet.setPackageRegistry(packageRegistry);
- return load(fileName, resourceSet);
- }
-
- public static EObject loadEcore(String fileName, EPackage.Registry packageRegistry)
- {
- return load(fileName, newEcoreResourceSet(packageRegistry));
- }
-
- public static EObject loadEcore(String fileName)
- {
- return load(fileName, newEcoreResourceSet());
- }
-
- public static void save(String fileName, EObject root, ResourceSet resourceSet)
- {
- save(fileName, Collections.singletonList(root), resourceSet);
- }
-
- public static void save(String fileName, List<EObject> roots, ResourceSet resourceSet)
- {
- URI uri = URI.createURI(fileName);
- Resource resource = resourceSet.createResource(uri);
- for (EObject root : roots)
- {
- EObject copy = EcoreUtil.copy(root);
- resource.getContents().add(copy);
- }
-
- try
- {
- resource.save(null);
- }
- catch (IOException ex)
- {
- throw new IORuntimeException(ex);
- }
- }
-
- public static void saveXMI(String fileName, EObject root)
- {
- save(fileName, root, newXMIResourceSet());
- }
-
- public static void saveXMI(String fileName, List<EObject> roots)
- {
- save(fileName, roots, newXMIResourceSet());
- }
-
- public static void saveEcore(String fileName, EObject root)
- {
- save(fileName, root, newEcoreResourceSet());
- }
-
- public static int countAllContents(EObject eObject)
- {
- int count = 0;
- for (TreeIterator<EObject> it = eObject.eAllContents(); it.hasNext(); it.next())
- {
- ++count;
- }
-
- return count;
- }
-
- public static EClass[] getConcreteClasses(EPackage ePackage)
- {
- List<EClass> result = new ArrayList<EClass>(0);
- for (EClassifier classifier : ePackage.getEClassifiers())
- {
- if (classifier instanceof EClass)
- {
- EClass eClass = (EClass)classifier;
- if (!eClass.isAbstract() && !eClass.isInterface())
- {
- result.add(eClass);
- }
- }
- }
-
- return result.toArray(new EClass[result.size()]);
- }
-
public static EClass[] getPersistentClasses(EPackage ePackage)
{
List<EClass> result = new ArrayList<EClass>();
@@ -360,25 +199,26 @@ public final class EMFUtil
return value.getClass() == EPackageImpl.class;
}
- public static boolean isMany(EStructuralFeature eFeature)
- {
- return eFeature.isMany();
- }
-
- public static boolean isReference(EStructuralFeature eFeature)
+ public static String getParentURI(EPackage ePackage)
{
- return eFeature instanceof EReference;
+ EPackage superPackage = ePackage.getESuperPackage();
+ String parentURI = superPackage == null ? null : superPackage.getNsURI();
+ return parentURI;
}
- public static boolean isContainment(EStructuralFeature eFeature)
+ public static void registerPackage(EPackage ePackage, EPackage.Registry... packageRegistries)
{
- if (isReference(eFeature))
+ ePackage.getClass(); // Initialize package in standalone mode
+ if (packageRegistries == null || packageRegistries.length == 0)
{
- EReference ref = (EReference)eFeature;
- return ref.isContainment();
+ EPackage.Registry[] globalRegistry = { EPackage.Registry.INSTANCE };
+ packageRegistries = globalRegistry;
}
- return false;
+ for (EPackage.Registry packageRegistry : packageRegistries)
+ {
+ packageRegistry.put(ePackage.getNsURI(), ePackage);
+ }
}
public static byte[] getEPackageBytes(EPackage ePackage, boolean zipped, EPackage.Registry packageRegistry)
@@ -497,4 +337,23 @@ public final class EMFUtil
builder.append(classifier.getName());
return builder.toString();
}
+
+ public static ResourceSet newResourceSet(Resource.Factory resourceFactory)
+ {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", resourceFactory); //$NON-NLS-1$
+ return resourceSet;
+ }
+
+ public static ResourceSet newEcoreResourceSet(EPackage.Registry packageRegistry)
+ {
+ ResourceSet resourceSet = newResourceSet(new EcoreResourceFactoryImpl());
+ resourceSet.setPackageRegistry(packageRegistry);
+ return resourceSet;
+ }
+
+ public static ResourceSet newEcoreResourceSet()
+ {
+ return newEcoreResourceSet(EPackage.Registry.INSTANCE);
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionResolverImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionResolverImpl.java
index 01644e64cf..417d44aa0e 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionResolverImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionResolverImpl.java
@@ -242,6 +242,7 @@ public abstract class CDORevisionResolverImpl extends Lifecycle implements CDORe
addCachedRevisionIfNotNull(revision);
}
}
+
return revision;
}
finally
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContextImpl.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContextImpl.java
index ef986b5cae..b969a59922 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContextImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContextImpl.java
@@ -477,11 +477,13 @@ public class TransactionCommitContextImpl implements Transaction.InternalCommitC
}
}
}
+
if (!originObject.isCurrent())
{
throw new ConcurrentModificationException("Trying to update object " + dirtyObjectDelta.getID()
+ " that was already modified");
}
+
InternalCDORevision dirtyObject = (InternalCDORevision)originObject.copy();
dirtyObjectDelta.apply(dirtyObject);
dirtyObject.setCreated(timeStamp);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java
index 987200dc69..141c569bd9 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java
@@ -190,6 +190,7 @@ public class MEMStoreAccessor extends LongIDStoreAccessor
throw new ConcurrentModificationException("Trying to update object " + revisionDelta.getID()
+ " that was already modified");
}
+
InternalCDORevision newRevision = (InternalCDORevision)revision.copy();
revisionDelta.apply(newRevision);
newRevision.setCreated(created);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/AbstractSyncRevisionsIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/AbstractSyncRevisionsIndication.java
index 4a06e81168..e6e9eaf7db 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/AbstractSyncRevisionsIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/AbstractSyncRevisionsIndication.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Simon McDuff - initial API and implementation
* Eike Stepper - maintenance
@@ -104,7 +104,6 @@ public abstract class AbstractSyncRevisionsIndication extends CDOReadIndication
{
detachedObjects.add(new Pair<CDOID, Long>(id, getTimestamp(id, version)));
}
-
}
protected long getTimestamp(CDOID id, int version)
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LockObjectsIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LockObjectsIndication.java
index e1690ddbc5..6c81cbed30 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LockObjectsIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LockObjectsIndication.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Simon McDuff - initial API and implementation
* Eike Stepper - maintenance
@@ -77,6 +77,7 @@ public class LockObjectsIndication extends AbstractSyncRevisionsIndication
getRepository().getLockManager().unlock(lockType, view, ids);
throw new IllegalArgumentException(detachedObjects.size() + " objects are not persistent anymore");
}
+
super.responding(out);
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SyncRevisionsIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SyncRevisionsIndication.java
index f60d01432e..1eee2c94b9 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SyncRevisionsIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SyncRevisionsIndication.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Simon McDuff - initial API and implementation
* Eike Stepper - maintenance
@@ -61,5 +61,4 @@ public class SyncRevisionsIndication extends AbstractSyncRevisionsIndication
udpateObjectList(id, version);
}
}
-
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/net4j/org/eclipse/net4j/tests/TestEMFUtil.java b/plugins/org.eclipse.emf.cdo.tests/net4j/org/eclipse/net4j/tests/TestEMFUtil.java
new file mode 100644
index 0000000000..b5f3d442c3
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/net4j/org/eclipse/net4j/tests/TestEMFUtil.java
@@ -0,0 +1,229 @@
+/**
+ * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Victor Roldan Betancort - maintenance
+ */
+package org.eclipse.net4j.tests;
+
+import org.eclipse.net4j.util.io.IORuntimeException;
+
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EPackage.Registry;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Eike Stepper
+ */
+public final class TestEMFUtil
+{
+ public static List<EObject> loadMultiple(String fileName, ResourceSet resourceSet)
+ {
+ Resource resource = resourceSet.getResource(URI.createURI(fileName), true);
+ return resource.getContents();
+ }
+
+ public static EObject load(String fileName, ResourceSet resourceSet)
+ {
+ return loadMultiple(fileName, resourceSet).get(0);
+ }
+
+ /**
+ * returns the first node of the resource content
+ */
+ public static EObject loadXMI(String fileName, EPackage... ePackages)
+ {
+ ResourceSet resourceSet = newXMIResourceSet(ePackages);
+ return load(fileName, resourceSet);
+ }
+
+ public static EObject loadXMI(String fileName, EPackage.Registry packageRegistry)
+ {
+ ResourceSet resourceSet = newXMIResourceSet();
+ resourceSet.setPackageRegistry(packageRegistry);
+ return load(fileName, resourceSet);
+ }
+
+ public static List<EObject> loadXMIMultiple(String fileName, EPackage.Registry packageRegistry)
+ {
+ ResourceSet resourceSet = newXMIResourceSet();
+ resourceSet.setPackageRegistry(packageRegistry);
+ return loadMultiple(fileName, resourceSet);
+ }
+
+ public static List<EObject> loadXMIMultiple(String fileName, EPackage... ePackages)
+ {
+ ResourceSet resourceSet = newXMIResourceSet(ePackages);
+ return loadMultiple(fileName, resourceSet);
+ }
+
+ public static EObject loadEcore(String fileName, EPackage.Registry packageRegistry)
+ {
+ return load(fileName, newEcoreResourceSet(packageRegistry));
+ }
+
+ public static EObject loadEcore(String fileName)
+ {
+ return load(fileName, newEcoreResourceSet());
+ }
+
+ public static void save(String fileName, EObject root, ResourceSet resourceSet)
+ {
+ save(fileName, Collections.singletonList(root), resourceSet);
+ }
+
+ public static void save(String fileName, List<EObject> roots, ResourceSet resourceSet)
+ {
+ URI uri = URI.createURI(fileName);
+ Resource resource = resourceSet.createResource(uri);
+
+ Collection<EObject> copiedRoots = EcoreUtil.copyAll(roots);
+ resource.getContents().addAll(copiedRoots);
+
+ try
+ {
+ resource.save(null);
+ }
+ catch (IOException ex)
+ {
+ throw new IORuntimeException(ex);
+ }
+ }
+
+ public static void saveXMI(String fileName, EObject root)
+ {
+ save(fileName, root, newXMIResourceSet());
+ }
+
+ public static void saveXMI(String fileName, List<EObject> roots)
+ {
+ save(fileName, roots, newXMIResourceSet());
+ }
+
+ public static void saveEcore(String fileName, EObject root)
+ {
+ save(fileName, root, newEcoreResourceSet());
+ }
+
+ public static ResourceSet newXMIResourceSet(EPackage... ePackages)
+ {
+ ResourceSet resourceSet = newResourceSet(new XMIResourceFactoryImpl());
+ if (ePackages != null && ePackages.length != 0)
+ {
+ Registry packageRegistry = resourceSet.getPackageRegistry();
+ for (EPackage ePackage : ePackages)
+ {
+ packageRegistry.put(ePackage.getNsURI(), ePackage);
+ }
+ }
+
+ return resourceSet;
+ }
+
+ public static ResourceSet newEcoreResourceSet()
+ {
+ return newEcoreResourceSet(EPackage.Registry.INSTANCE);
+ }
+
+ public static ResourceSet newResourceSet(Resource.Factory resourceFactory)
+ {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", resourceFactory);
+ return resourceSet;
+ }
+
+ public static ResourceSet newEcoreResourceSet(EPackage.Registry packageRegistry)
+ {
+ ResourceSet resourceSet = newResourceSet(new EcoreResourceFactoryImpl());
+ resourceSet.setPackageRegistry(packageRegistry);
+ return resourceSet;
+ }
+
+ public static int countAllContents(EObject eObject)
+ {
+ int count = 0;
+ for (TreeIterator<EObject> it = eObject.eAllContents(); it.hasNext(); it.next())
+ {
+ ++count;
+ }
+
+ return count;
+ }
+
+ public static EClass[] getConcreteClasses(EPackage ePackage)
+ {
+ List<EClass> result = new ArrayList<EClass>(0);
+ for (EClassifier classifier : ePackage.getEClassifiers())
+ {
+ if (classifier instanceof EClass)
+ {
+ EClass eClass = (EClass)classifier;
+ if (!eClass.isAbstract() && !eClass.isInterface())
+ {
+ result.add(eClass);
+ }
+ }
+ }
+
+ return result.toArray(new EClass[result.size()]);
+ }
+
+ public static boolean isMany(EStructuralFeature eFeature)
+ {
+ return eFeature.isMany();
+ }
+
+ public static boolean isReference(EStructuralFeature eFeature)
+ {
+ return eFeature instanceof EReference;
+ }
+
+ public static boolean isContainment(EStructuralFeature eFeature)
+ {
+ if (isReference(eFeature))
+ {
+ EReference ref = (EReference)eFeature;
+ return ref.isContainment();
+ }
+
+ return false;
+ }
+
+ public static void registerPackage(EPackage ePackage, EPackage.Registry... packageRegistries)
+ {
+ ePackage.getClass(); // Initialize package in standalone mode
+ if (packageRegistries == null || packageRegistries.length == 0)
+ {
+ EPackage.Registry[] globalRegistry = { EPackage.Registry.INSTANCE };
+ packageRegistries = globalRegistry;
+ }
+
+ for (EPackage.Registry packageRegistry : packageRegistries)
+ {
+ packageRegistry.put(ePackage.getNsURI(), ePackage);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsAllConfigs.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsAllConfigs.java
index 1ad89757dc..d3f6d6b118 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsAllConfigs.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTestsAllConfigs.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
@@ -49,6 +49,7 @@ import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_270429_Test;
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_272861_Test;
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_273233_Test;
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_273565_Test;
+import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_273758_Test;
import org.eclipse.emf.cdo.tests.config.impl.ConfigTest;
import org.eclipse.emf.cdo.tests.config.impl.ConfigTestSuite;
@@ -145,6 +146,7 @@ public abstract class AllTestsAllConfigs extends ConfigTestSuite
testClasses.add(Bugzilla_272861_Test.class);
testClasses.add(Bugzilla_273233_Test.class);
testClasses.add(Bugzilla_273565_Test.class);
+ testClasses.add(Bugzilla_273758_Test.class);
// TODO testClasses.add(NonCDOResourceTest.class);
// TODO testClasses.add(GeneratedEcoreTest.class);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFTest.java
index 5b918bc5fd..1eabe5eb63 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFTest.java
@@ -10,9 +10,8 @@
*/
package org.eclipse.emf.cdo.tests;
-import org.eclipse.emf.cdo.common.model.EMFUtil;
-
import org.eclipse.net4j.tests.AbstractOMTest;
+import org.eclipse.net4j.tests.TestEMFUtil;
import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.emf.common.util.URI;
@@ -37,7 +36,7 @@ public class EMFTest extends AbstractOMTest
public void testProxy() throws Exception
{
- EPackage model2 = (EPackage)EMFUtil.loadXMI("model2.ecore");
+ EPackage model2 = (EPackage)TestEMFUtil.loadXMI("model2.ecore");
EClass companyProxy = (EClass)model2.getEClassifier("CompanyProxy");
EReference reference = (EReference)companyProxy.getEStructuralFeature("company");
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java
index f3e481d107..c7bb22df1c 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java
@@ -10,12 +10,13 @@
*/
package org.eclipse.emf.cdo.tests;
-import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.CDOUtil;
+import org.eclipse.net4j.tests.TestEMFUtil;
+
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
@@ -40,7 +41,7 @@ public class GeneratedEcoreTest extends AbstractCDOTest
CDOTransaction transaction1 = session1.openTransaction();
CDOResource res1 = transaction1.createResource("/res");
- EPackage root1 = (EPackage)EMFUtil.loadEcore("model1.ecore", session1.getPackageRegistry());
+ EPackage root1 = (EPackage)TestEMFUtil.loadEcore("model1.ecore", session1.getPackageRegistry());
res1.getContents().add(root1);
transaction1.commit();
@@ -55,7 +56,7 @@ public class GeneratedEcoreTest extends AbstractCDOTest
assertEquals(res2, root2.eResource());
CDOUtil.load(root2, transaction2);
- EMFUtil.saveEcore("model1X.ecore", root2);
+ TestEMFUtil.saveEcore("model1X.ecore", root2);
// assertTrue("Models differ", EcoreUtil.equals(root1, root2));
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java
index 5d1634ab7d..ee974f0a86 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java
@@ -204,6 +204,7 @@ public class LockingManagerTest extends AbstractCDOTest
CDOObject cdoCompany2 = CDOUtil.getCDOObject(company2);
transaction.commit();
+
try
{
cdoCompany2.cdoReadLock().lock();
@@ -211,8 +212,8 @@ public class LockingManagerTest extends AbstractCDOTest
}
catch (IllegalArgumentException ex)
{
-
}
+
assertEquals(false, cdoCompany2.cdoReadLock().isLocked());
assertEquals(false, cdoCompany2.cdoReadLock().isLockedByOthers());
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_273565_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_273565_Test.java
index 2ed15dd435..b04e46667b 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_273565_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_273565_Test.java
@@ -153,6 +153,7 @@ public class Bugzilla_273565_Test extends AbstractCDOTest
Thread.sleep(100);
}
+
transaction.getLock().lock();
transaction.getLock().unlock();
@@ -178,7 +179,6 @@ public class Bugzilla_273565_Test extends AbstractCDOTest
for (int i = 0; i < 50 && exception[0] == null; i++)
{
-
orderDetail.setPrice(1);
CDOUtil.getCDOObject(orderDetail.getOrder()).cdoWriteLock().lock();
orderDetail.getOrder().getOrderDetails().add(getModel1Factory().createOrderDetail());
@@ -194,6 +194,7 @@ public class Bugzilla_273565_Test extends AbstractCDOTest
Thread.sleep(100);
}
+
transaction.getLock().lock();
transaction.getLock().unlock();
}
@@ -255,7 +256,6 @@ public class Bugzilla_273565_Test extends AbstractCDOTest
CDOUtil.getCDOObject(orderDetail).cdoWriteLock().lock();
orderDetail.setPrice(1);
transaction.commit();
-
}
done[0] = true;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_273758_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_273758_Test.java
new file mode 100644
index 0000000000..71f6c93ccd
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_273758_Test.java
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ */
+package org.eclipse.emf.cdo.tests.bugzilla;
+
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.tests.AbstractCDOTest;
+import org.eclipse.emf.cdo.tests.model1.Model1Package;
+import org.eclipse.emf.cdo.tests.model1.OrderDetail;
+import org.eclipse.emf.cdo.tests.model1.Product1;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+
+import org.eclipse.net4j.tests.TestEMFUtil;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Export resource miss all of the oneToMany references
+ * <p>
+ * See https://bugs.eclipse.org/273758
+ *
+ * @author Victor Roldan Betancort
+ */
+public class Bugzilla_273758_Test extends AbstractCDOTest
+{
+ public void test_export_resource_contents() throws Exception
+ {
+ {
+ // Create 3 root objects: 1 Product1, 2 OrderDetails.
+ // Product1 will reference both OrderDetails
+
+ Product1 product = getModel1Factory().createProduct1();
+ OrderDetail detail1 = getModel1Factory().createOrderDetail();
+ detail1.setPrice(1.99f);
+ OrderDetail detail2 = getModel1Factory().createOrderDetail();
+ detail2.setPrice(9.99f);
+
+ product.getOrderDetails().add(detail1);
+ product.getOrderDetails().add(detail2);
+
+ CDOSession session = openModel1Session();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource("/test1");
+
+ resource.getContents().add(product);
+ resource.getContents().add(detail1);
+ resource.getContents().add(detail2);
+
+ transaction.commit();
+ session.close();
+ }
+
+ {
+ CDOSession session = openModel1Session();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.getResource("/test1");
+
+ Product1 product2 = (Product1)resource.getContents().get(0);
+ // Check in memory Product1 EObject reference integrity
+ assertEquals(2, product2.getOrderDetails().size());
+
+ Collection<EObject> collection = EcoreUtil.copyAll(resource.getContents());
+ List<EObject> sourceContents = new ArrayList<EObject>(collection);
+
+ // Target Resource
+ File file = File.createTempFile("exportModel1", null);
+ String tempFileURI = file.toURI().toString();
+ TestEMFUtil.saveXMI(tempFileURI, sourceContents);
+
+ List<EObject> list = TestEMFUtil.loadXMIMultiple(tempFileURI, Model1Package.eINSTANCE);
+ Product1 product3 = (Product1)list.get(0);
+ assertEquals(2, product3.getOrderDetails().size());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ExportResourceAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ExportResourceAction.java
index 0b4b911add..ecb5ee4aad 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ExportResourceAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ExportResourceAction.java
@@ -11,21 +11,28 @@
*/
package org.eclipse.emf.cdo.internal.ui.actions;
-import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.internal.ui.dialogs.ExportResourceDialog;
import org.eclipse.emf.cdo.ui.messages.Messages;
import org.eclipse.emf.cdo.view.CDOView;
+import org.eclipse.net4j.util.io.IORuntimeException;
+
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.ui.IWorkbenchPage;
+import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
/**
@@ -79,8 +86,27 @@ public class ExportResourceAction extends ViewAction
// Source Resource
Resource source = view.getResource(targetPath);
List<EObject> sourceContents = new ArrayList<EObject>(source.getContents());
+ exportObjects(sourceContents);
+ }
+ private void exportObjects(List<EObject> sourceContents)
+ {
// Target Resource
- EMFUtil.saveXMI(sourceURI.toString(), sourceContents);
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(
+ Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
+ Resource resource = resourceSet.createResource(sourceURI);
+
+ Collection<EObject> copiedRoots = EcoreUtil.copyAll(sourceContents);
+ resource.getContents().addAll(copiedRoots);
+
+ try
+ {
+ resource.save(null);
+ }
+ catch (IOException ex)
+ {
+ throw new IORuntimeException(ex);
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/AbstractSyncRevisionsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/AbstractSyncRevisionsRequest.java
index 8f447ed197..79d094f9ce 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/AbstractSyncRevisionsRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/AbstractSyncRevisionsRequest.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Simon McDuff - initial API and implementation
* Eike Stepper - maintenance
@@ -121,6 +121,7 @@ public abstract class AbstractSyncRevisionsRequest extends CDOClientRequest<Coll
((CDOTimeStampContextImpl)timestampContext).setDirtyObjects(dirtyObjects);
((CDOTimeStampContextImpl)timestampContext).setDetachedObjects(detachedObjects);
}
+
return Collections.unmodifiableCollection(mapofContext.values());
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java
index 65ed4b1fd1..b3982417cf 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Simon McDuff - initial API and implementation
* Eike Stepper - maintenance
@@ -29,7 +29,6 @@ import java.util.Map;
*/
public class SyncRevisionsRequest extends AbstractSyncRevisionsRequest
{
-
public SyncRevisionsRequest(CDOClientProtocol protocol, Map<CDOID, CDOIDAndVersion> idAndVersions, int referenceChunk)
{
this(protocol, CDOProtocolConstants.SIGNAL_SYNC_REVISIONS, idAndVersions, referenceChunk);
@@ -51,6 +50,7 @@ public class SyncRevisionsRequest extends AbstractSyncRevisionsRequest
getSession().handleSyncResponse(timestampContext.getTimeStamp(), emptyNewPackageUnits,
timestampContext.getDirtyObjects(), timestampContext.getDetachedObjects());
}
+
return contexts;
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDORevisionManagerImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDORevisionManagerImpl.java
index d2022f9576..5459a9b217 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDORevisionManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDORevisionManagerImpl.java
@@ -141,7 +141,6 @@ public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements C
{
throw WrappedException.wrap(ex);
}
-
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
index a323935063..afd8021dd8 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
@@ -289,7 +289,6 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
public void getCDOIDAndVersion(Map<CDOID, CDOIDAndVersion> uniqueObjects, Collection<? extends CDOObject> cdoObjects)
{
Map<CDOID, CDORevisionDelta> deltaMap = getRevisionDeltas();
-
for (CDOObject cdoObject : cdoObjects)
{
CDORevision cdoRevision = CDOStateMachine.INSTANCE.readNoLoad((InternalCDOObject)cdoObject);
@@ -305,6 +304,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
version = delta.getOriginVersion();
}
}
+
uniqueObjects.put(cdoId, CDOIDUtil.createIDAndVersion(cdoId, version));
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
index 20e8bf313b..aff42b181e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
@@ -289,6 +289,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
.put(object.cdoID(), CDOIDUtil.createIDAndVersion(object.cdoID(), CDORevision.UNSPECIFIED_VERSION));
}
}
+
session.getSessionProtocol().lockObjects(this, uniqueObjects, timeout, lockType);
}
@@ -1157,6 +1158,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
{
dirtyObject = objects.get(dirtyOID.getID());
}
+
if (dirtyObject != null)
{
CDOStateMachine.INSTANCE.invalidate(dirtyObject, dirtyOID.getVersion());
@@ -1172,6 +1174,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
}
}
}
+
for (CDOID id : detachedOIDs)
{
InternalCDOObject detachedObject = removeObject(id);
@@ -1190,6 +1193,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
}
}
}
+
return conflicts;
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java
index d5b1b3d422..0af8feb333 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java
@@ -52,5 +52,4 @@ public interface InternalCDOSession extends CDOSession, CDOIDObjectFactory,
*/
public void handleUpdateRevision(final long timeStamp, Set<CDOIDAndVersion> dirtyOIDs,
Collection<CDOID> detachedObjects);
-
}

Back to the top