Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-09-22 02:53:19 -0400
committerEike Stepper2018-09-22 02:53:19 -0400
commitb4c0f92cc81c31e1b42c9ad984ec9b3b5e35e434 (patch)
treeb06c46b057dca8cb9039202329be87daad934612
parent3a01b3a8ad45368a29ce217fce7d36912d0a13b6 (diff)
downloadcdo-b4c0f92cc81c31e1b42c9ad984ec9b3b5e35e434.tar.gz
cdo-b4c0f92cc81c31e1b42c9ad984ec9b3b5e35e434.tar.xz
cdo-b4c0f92cc81c31e1b42c9ad984ec9b3b5e35e434.zip
[256856] Support model evolution
https://bugs.eclipse.org/bugs/show_bug.cgi?id=256856
-rw-r--r--plugins/org.eclipse.emf.cdo.evolution.editor/src/org/eclipse/emf/cdo/evolution/presentation/quickfix/DefaultDiagnosticResolutionGenerator.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionValidator.java40
-rw-r--r--plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF52
-rw-r--r--plugins/org.eclipse.emf.cdo/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOViewSet.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewSetImpl.java16
6 files changed, 93 insertions, 27 deletions
diff --git a/plugins/org.eclipse.emf.cdo.evolution.editor/src/org/eclipse/emf/cdo/evolution/presentation/quickfix/DefaultDiagnosticResolutionGenerator.java b/plugins/org.eclipse.emf.cdo.evolution.editor/src/org/eclipse/emf/cdo/evolution/presentation/quickfix/DefaultDiagnosticResolutionGenerator.java
index 75fd4aa4e5..679d55aab3 100644
--- a/plugins/org.eclipse.emf.cdo.evolution.editor/src/org/eclipse/emf/cdo/evolution/presentation/quickfix/DefaultDiagnosticResolutionGenerator.java
+++ b/plugins/org.eclipse.emf.cdo.evolution.editor/src/org/eclipse/emf/cdo/evolution/presentation/quickfix/DefaultDiagnosticResolutionGenerator.java
@@ -353,6 +353,8 @@ public class DefaultDiagnosticResolutionGenerator extends BasicDiagnosticResolut
Collection<EPackage> rootPackages = EcoreUtil.copyAll(evolution.getRootPackages());
release.getRootPackages().addAll(rootPackages);
+ // Prepare for new development...
+
for (EPackage rootPackage : evolution.getRootPackages())
{
ElementHandler.execute(rootPackage, new ElementRunnable()
@@ -364,6 +366,8 @@ public class DefaultDiagnosticResolutionGenerator extends BasicDiagnosticResolut
});
}
+ evolution.getMigrations().clear();
+
ModelSetChangeImpl change = (ModelSetChangeImpl)evolution.getChange();
if (change != null)
{
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionValidator.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionValidator.java
index d16997899a..2828fb75a0 100644
--- a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionValidator.java
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionValidator.java
@@ -19,15 +19,19 @@ import org.eclipse.emf.cdo.evolution.impl.EvolutionPlugin;
import org.eclipse.net4j.util.collection.CollectionUtil;
import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.EMap;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EModelElement;
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.EcorePackage;
import org.eclipse.emf.ecore.util.EObjectValidator;
@@ -35,6 +39,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil.EqualityHelper;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -432,6 +437,41 @@ public class EvolutionValidator extends EObjectValidator
return super.haveEqualFeature(eObject1, eObject2, feature);
}
+
+ @Override
+ protected boolean haveEqualReference(EObject eObject, EObject releasedObject, EReference reference)
+ {
+ boolean result = super.haveEqualReference(eObject, releasedObject, reference);
+ if (!result && reference == EcorePackage.Literals.EANNOTATION__DETAILS)
+ {
+ // As part of the release process (quick fix) the old values of ID annotations are deleted.
+ // Adjust the comparison to ignore this fact.
+ EMap<String, String> releasedDetails = ((EAnnotation)releasedObject).getDetails();
+ if (releasedDetails.containsKey(IDAnnotation.OLD_VALUE_KEY))
+ {
+ EList<Map.Entry<String, String>> replacementList = new BasicEList<Map.Entry<String, String>>(releasedDetails);
+ for (Iterator<Map.Entry<String, String>> it = replacementList.iterator(); it.hasNext();)
+ {
+ Map.Entry<String, String> entry = it.next();
+ if (IDAnnotation.OLD_VALUE_KEY.equals(entry.getKey()))
+ {
+ it.remove();
+
+ @SuppressWarnings("unchecked")
+ List<EObject> list1 = (List<EObject>)(Object)((EAnnotation)eObject).getDetails();
+
+ @SuppressWarnings("unchecked")
+ List<EObject> list2 = (List<EObject>)(Object)replacementList;
+
+ result = equals(list1, list2);
+ break;
+ }
+ }
+ }
+ }
+
+ return result;
+ }
};
if (!equalityHelper.equals(ePackage, releasedPackage))
diff --git a/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
index cc9efeacf5..572130d344 100644
--- a/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.cdo; singleton:=true
-Bundle-Version: 4.6.200.qualifier
+Bundle-Version: 4.7.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -10,28 +10,28 @@ Bundle-Activator: org.eclipse.emf.internal.cdo.bundle.Activator$Implementation
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)";resolution:=optional,
org.eclipse.emf.cdo.common;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo;version="4.6.200",
- org.eclipse.emf.cdo.eresource;version="4.6.200",
- org.eclipse.emf.cdo.eresource.impl;version="4.6.200",
- org.eclipse.emf.cdo.eresource.util;version="4.6.200",
- org.eclipse.emf.cdo.eresource.validation;version="4.6.200",
- org.eclipse.emf.cdo.etypes;version="4.6.200",
- org.eclipse.emf.cdo.etypes.impl;version="4.6.200",
- org.eclipse.emf.cdo.etypes.util;version="4.6.200",
- org.eclipse.emf.cdo.session;version="4.6.200",
- org.eclipse.emf.cdo.session.remote;version="4.6.200",
- org.eclipse.emf.cdo.transaction;version="4.6.200",
- org.eclipse.emf.cdo.util;version="4.6.200",
- org.eclipse.emf.cdo.view;version="4.6.200",
- org.eclipse.emf.internal.cdo;version="4.6.200",
- org.eclipse.emf.internal.cdo.analyzer;version="4.6.200";
+Export-Package: org.eclipse.emf.cdo;version="4.7.0",
+ org.eclipse.emf.cdo.eresource;version="4.7.0",
+ org.eclipse.emf.cdo.eresource.impl;version="4.7.0",
+ org.eclipse.emf.cdo.eresource.util;version="4.7.0",
+ org.eclipse.emf.cdo.eresource.validation;version="4.7.0",
+ org.eclipse.emf.cdo.etypes;version="4.7.0",
+ org.eclipse.emf.cdo.etypes.impl;version="4.7.0",
+ org.eclipse.emf.cdo.etypes.util;version="4.7.0",
+ org.eclipse.emf.cdo.session;version="4.7.0",
+ org.eclipse.emf.cdo.session.remote;version="4.7.0",
+ org.eclipse.emf.cdo.transaction;version="4.7.0",
+ org.eclipse.emf.cdo.util;version="4.7.0",
+ org.eclipse.emf.cdo.view;version="4.7.0",
+ org.eclipse.emf.internal.cdo;version="4.7.0",
+ org.eclipse.emf.internal.cdo.analyzer;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.ui",
- org.eclipse.emf.internal.cdo.bundle;version="4.6.200";x-friends:="org.eclipse.emf.cdo.ui",
- org.eclipse.emf.internal.cdo.messages;version="4.6.200";x-internal:=true,
- org.eclipse.emf.internal.cdo.object;version="4.6.200";
+ org.eclipse.emf.internal.cdo.bundle;version="4.7.0";x-friends:="org.eclipse.emf.cdo.ui",
+ org.eclipse.emf.internal.cdo.messages;version="4.7.0";x-internal:=true,
+ org.eclipse.emf.internal.cdo.object;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
@@ -40,13 +40,13 @@ Export-Package: org.eclipse.emf.cdo;version="4.6.200",
org.eclipse.emf.cdo.explorer,
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.edit",
- org.eclipse.emf.internal.cdo.query;version="4.6.200";
+ org.eclipse.emf.internal.cdo.query;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests.objectivity",
- org.eclipse.emf.internal.cdo.session;version="4.6.200";
+ org.eclipse.emf.internal.cdo.session;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
@@ -56,24 +56,24 @@ Export-Package: org.eclipse.emf.cdo;version="4.6.200",
org.eclipse.emf.cdo.security.ui,
org.eclipse.emf.cdo.explorer,
org.eclipse.emf.cdo.explorer.ui",
- org.eclipse.emf.internal.cdo.session.remote;version="4.6.200";
+ org.eclipse.emf.internal.cdo.session.remote;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.ui",
- org.eclipse.emf.internal.cdo.transaction;version="4.6.200";
+ org.eclipse.emf.internal.cdo.transaction;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.explorer.ui",
- org.eclipse.emf.internal.cdo.util;version="4.6.200";
+ org.eclipse.emf.internal.cdo.util;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.evolution",
- org.eclipse.emf.internal.cdo.view;version="4.6.200";
+ org.eclipse.emf.internal.cdo.view;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
@@ -81,6 +81,6 @@ Export-Package: org.eclipse.emf.cdo;version="4.6.200",
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.explorer,
org.eclipse.emf.cdo.explorer.ui",
- org.eclipse.emf.spi.cdo;version="4.6.200"
+ org.eclipse.emf.spi.cdo;version="4.7.0"
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.eclipse.emf.cdo
diff --git a/plugins/org.eclipse.emf.cdo/pom.xml b/plugins/org.eclipse.emf.cdo/pom.xml
index e6f81381bb..f883a640b7 100644
--- a/plugins/org.eclipse.emf.cdo/pom.xml
+++ b/plugins/org.eclipse.emf.cdo/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.emf.cdo</artifactId>
- <version>4.6.200-SNAPSHOT</version>
+ <version>4.7.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOViewSet.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOViewSet.java
index 12fe01f64c..4023a4a7cd 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOViewSet.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOViewSet.java
@@ -12,6 +12,7 @@
package org.eclipse.emf.cdo.view;
import org.eclipse.emf.cdo.eresource.CDOResourceFactory;
+import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.URI;
@@ -49,6 +50,11 @@ public interface CDOViewSet extends Notifier
public CDOView[] getViews();
+ /**
+ * @since 4.7
+ */
+ public CDOSession[] getSessions();
+
public CDOResourceFactory getResourceFactory();
public EPackage.Registry getPackageRegistry();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewSetImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewSetImpl.java
index ba7232e48d..f376df12c8 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewSetImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewSetImpl.java
@@ -18,6 +18,7 @@ import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.common.util.CDOException;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.CDOResourceFactory;
+import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.util.CDOURIUtil;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.cdo.view.CDOViewProvider;
@@ -99,6 +100,21 @@ public class CDOViewSetImpl extends NotifierImpl implements InternalCDOViewSet
}
}
+ public CDOSession[] getSessions()
+ {
+ Set<CDOSession> sessions = new HashSet<CDOSession>();
+
+ synchronized (views)
+ {
+ for (CDOView view : views)
+ {
+ sessions.add(view.getSession());
+ }
+ }
+
+ return sessions.toArray(new CDOSession[sessions.size()]);
+ }
+
/**
* @throws IllegalArgumentException
* if repositoryUUID doesn't match any CDOView.

Back to the top