contents = ((Resource)notifier).getContents();
+ if (contents.isEmpty())
+ {
+ return null;
+ }
+
+ notifier = contents.get(0);
+ }
+
+ if (notifier instanceof Evolution)
+ {
+ return (Evolution)notifier;
+ }
+
+ if (notifier instanceof EObject)
+ {
+ Resource resource = ((EObject)notifier).eResource();
+ if (resource != null)
+ {
+ return get(resource.getResourceSet());
+ }
+ }
+
+ return null;
+ }
+
+} // EvolutionImpl
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionPackageImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionPackageImpl.java
new file mode 100644
index 0000000000..3f66950b8f
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionPackageImpl.java
@@ -0,0 +1,1306 @@
+/**
+ */
+package org.eclipse.emf.cdo.evolution.impl;
+
+import org.eclipse.emf.cdo.evolution.Change;
+import org.eclipse.emf.cdo.evolution.ChangeKind;
+import org.eclipse.emf.cdo.evolution.ElementChange;
+import org.eclipse.emf.cdo.evolution.Evolution;
+import org.eclipse.emf.cdo.evolution.EvolutionFactory;
+import org.eclipse.emf.cdo.evolution.EvolutionPackage;
+import org.eclipse.emf.cdo.evolution.FeaturePathMigration;
+import org.eclipse.emf.cdo.evolution.Migration;
+import org.eclipse.emf.cdo.evolution.Model;
+import org.eclipse.emf.cdo.evolution.ModelSet;
+import org.eclipse.emf.cdo.evolution.ModelSetChange;
+import org.eclipse.emf.cdo.evolution.PropertyChange;
+import org.eclipse.emf.cdo.evolution.Release;
+import org.eclipse.emf.cdo.evolution.util.EvolutionValidator;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EGenericType;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.ETypeParameter;
+import org.eclipse.emf.ecore.EValidator;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+/**
+ *
+ * An implementation of the model Package.
+ *
+ * @generated
+ */
+public class EvolutionPackageImpl extends EPackageImpl implements EvolutionPackage
+{
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass modelSetEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass modelEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass evolutionEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass releaseEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass changeEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass modelSetChangeEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass elementChangeEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass propertyChangeEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass migrationEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass featurePathMigrationEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EEnum changeKindEEnum = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EDataType uriEDataType = null;
+
+ /**
+ * Creates an instance of the model Package, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ *
+ *
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private EvolutionPackageImpl()
+ {
+ super(eNS_URI, EvolutionFactory.eINSTANCE);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the Package for this model, and for any others upon which it depends.
+ *
+ *
This method is used to initialize {@link EvolutionPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ *
+ *
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static EvolutionPackage init()
+ {
+ if (isInited)
+ {
+ return (EvolutionPackage)EPackage.Registry.INSTANCE.getEPackage(EvolutionPackage.eNS_URI);
+ }
+
+ // Obtain or create and register package
+ Object registeredEvolutionPackage = EPackage.Registry.INSTANCE.get(eNS_URI);
+ EvolutionPackageImpl theEvolutionPackage = registeredEvolutionPackage instanceof EvolutionPackageImpl ? (EvolutionPackageImpl)registeredEvolutionPackage
+ : new EvolutionPackageImpl();
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ EcorePackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theEvolutionPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theEvolutionPackage.initializePackageContents();
+
+ // Register package validator
+ EValidator.Registry.INSTANCE.put(theEvolutionPackage, new EValidator.Descriptor()
+ {
+ public EValidator getEValidator()
+ {
+ return EvolutionValidator.INSTANCE;
+ }
+ });
+
+ // Mark meta-data to indicate it can't be changed
+ theEvolutionPackage.freeze();
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(EvolutionPackage.eNS_URI, theEvolutionPackage);
+ return theEvolutionPackage;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getModelSet()
+ {
+ return modelSetEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getModelSet_Change()
+ {
+ return (EReference)modelSetEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getModelSet_Migrations()
+ {
+ return (EReference)modelSetEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getModelSet__GetEvolution()
+ {
+ return modelSetEClass.getEOperations().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getModelSet__GetVersion()
+ {
+ return modelSetEClass.getEOperations().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getModelSet__GetPreviousRelease()
+ {
+ return modelSetEClass.getEOperations().get(2);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getModelSet__GetRootPackages()
+ {
+ return modelSetEClass.getEOperations().get(3);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getModelSet__GetAllPackages()
+ {
+ return modelSetEClass.getEOperations().get(4);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getModelSet__ContainsElement__EModelElement()
+ {
+ return modelSetEClass.getEOperations().get(5);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getModelSet__GetElement__String()
+ {
+ return modelSetEClass.getEOperations().get(6);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getModelSet__GetElementID__EModelElement()
+ {
+ return modelSetEClass.getEOperations().get(7);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getModelSet__GetElementID__EModelElement_boolean()
+ {
+ return modelSetEClass.getEOperations().get(8);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getModelSet__Compare__ModelSet()
+ {
+ return modelSetEClass.getEOperations().get(9);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getModelSet__GetMigration__String()
+ {
+ return modelSetEClass.getEOperations().get(10);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getModel()
+ {
+ return modelEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getModel_Evolution()
+ {
+ return (EReference)modelEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getModel_URI()
+ {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getModel_RootPackage()
+ {
+ return (EReference)modelEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getModel_AllPackages()
+ {
+ return (EReference)modelEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getModel_ReferencedPackages()
+ {
+ return (EReference)modelEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getModel_MissingPackages()
+ {
+ return (EReference)modelEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getEvolution()
+ {
+ return evolutionEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getEvolution_Models()
+ {
+ return (EReference)evolutionEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getEvolution_UseEcorePackage()
+ {
+ return (EAttribute)evolutionEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getEvolution_UseEresourcePackage()
+ {
+ return (EAttribute)evolutionEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getEvolution_UseEtypesPackage()
+ {
+ return (EAttribute)evolutionEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getEvolution_UniqueNamespaces()
+ {
+ return (EAttribute)evolutionEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getEvolution_RootPackages()
+ {
+ return (EReference)evolutionEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getEvolution_AllPackages()
+ {
+ return (EReference)evolutionEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getEvolution_Releases()
+ {
+ return (EReference)evolutionEClass.getEStructuralFeatures().get(8);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getEvolution_OrderedReleases()
+ {
+ return (EReference)evolutionEClass.getEStructuralFeatures().get(9);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getEvolution_LatestRelease()
+ {
+ return (EReference)evolutionEClass.getEStructuralFeatures().get(10);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getEvolution_NextReleaseVersion()
+ {
+ return (EAttribute)evolutionEClass.getEStructuralFeatures().get(11);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getEvolution_MissingPackages()
+ {
+ return (EReference)evolutionEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getEvolution__GetRelease__int()
+ {
+ return evolutionEClass.getEOperations().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getRelease()
+ {
+ return releaseEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getRelease_Evolution()
+ {
+ return (EReference)releaseEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getRelease_Date()
+ {
+ return (EAttribute)releaseEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getRelease_NextRelease()
+ {
+ return (EReference)releaseEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getRelease_PreviousRelease()
+ {
+ return (EReference)releaseEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getRelease_Version()
+ {
+ return (EAttribute)releaseEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getRelease_RootPackages()
+ {
+ return (EReference)releaseEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getRelease_AllPackages()
+ {
+ return (EReference)releaseEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getChange()
+ {
+ return changeEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getChange_Parent()
+ {
+ return (EReference)changeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getChange_Children()
+ {
+ return (EReference)changeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getChange__GetOldModelSet()
+ {
+ return changeEClass.getEOperations().get(3);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getChange__GetNewModelSet()
+ {
+ return changeEClass.getEOperations().get(4);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getChange__GetModelSetChange()
+ {
+ return changeEClass.getEOperations().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getChange__GetOldElementFor__EModelElement()
+ {
+ return changeEClass.getEOperations().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getChange__GetNewElementsFor__EModelElement()
+ {
+ return changeEClass.getEOperations().get(2);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getModelSetChange()
+ {
+ return modelSetChangeEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getModelSetChange_OldModelSet()
+ {
+ return (EReference)modelSetChangeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getModelSetChange_NewModelSet()
+ {
+ return (EReference)modelSetChangeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getElementChange()
+ {
+ return elementChangeEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getElementChange_OldElement()
+ {
+ return (EReference)elementChangeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getElementChange_NewElement()
+ {
+ return (EReference)elementChangeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getElementChange_Kind()
+ {
+ return (EAttribute)elementChangeEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EOperation getElementChange__GetElement()
+ {
+ return elementChangeEClass.getEOperations().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getPropertyChange()
+ {
+ return propertyChangeEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getPropertyChange_Feature()
+ {
+ return (EReference)propertyChangeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getPropertyChange_OldValue()
+ {
+ return (EAttribute)propertyChangeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getPropertyChange_NewValue()
+ {
+ return (EAttribute)propertyChangeEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getPropertyChange_Kind()
+ {
+ return (EAttribute)propertyChangeEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getMigration()
+ {
+ return migrationEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getMigration_ModelSet()
+ {
+ return (EReference)migrationEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getMigration_DiagnosticID()
+ {
+ return (EAttribute)migrationEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getFeaturePathMigration()
+ {
+ return featurePathMigrationEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getFeaturePathMigration_FromClass()
+ {
+ return (EReference)featurePathMigrationEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getFeaturePathMigration_ToClass()
+ {
+ return (EReference)featurePathMigrationEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getFeaturePathMigration_FeaturePath()
+ {
+ return (EReference)featurePathMigrationEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EEnum getChangeKind()
+ {
+ return changeKindEEnum;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EDataType getURI()
+ {
+ return uriEDataType;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EvolutionFactory getEvolutionFactory()
+ {
+ return (EvolutionFactory)getEFactoryInstance();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ *
+ *
+ * @generated
+ */
+ public void createPackageContents()
+ {
+ if (isCreated)
+ {
+ return;
+ }
+ isCreated = true;
+
+ // Create classes and their features
+ modelSetEClass = createEClass(MODEL_SET);
+ createEReference(modelSetEClass, MODEL_SET__CHANGE);
+ createEReference(modelSetEClass, MODEL_SET__MIGRATIONS);
+ createEOperation(modelSetEClass, MODEL_SET___GET_EVOLUTION);
+ createEOperation(modelSetEClass, MODEL_SET___GET_VERSION);
+ createEOperation(modelSetEClass, MODEL_SET___GET_PREVIOUS_RELEASE);
+ createEOperation(modelSetEClass, MODEL_SET___GET_ROOT_PACKAGES);
+ createEOperation(modelSetEClass, MODEL_SET___GET_ALL_PACKAGES);
+ createEOperation(modelSetEClass, MODEL_SET___CONTAINS_ELEMENT__EMODELELEMENT);
+ createEOperation(modelSetEClass, MODEL_SET___GET_ELEMENT__STRING);
+ createEOperation(modelSetEClass, MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT);
+ createEOperation(modelSetEClass, MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT_BOOLEAN);
+ createEOperation(modelSetEClass, MODEL_SET___COMPARE__MODELSET);
+ createEOperation(modelSetEClass, MODEL_SET___GET_MIGRATION__STRING);
+
+ modelEClass = createEClass(MODEL);
+ createEReference(modelEClass, MODEL__EVOLUTION);
+ createEAttribute(modelEClass, MODEL__URI);
+ createEReference(modelEClass, MODEL__ROOT_PACKAGE);
+ createEReference(modelEClass, MODEL__ALL_PACKAGES);
+ createEReference(modelEClass, MODEL__REFERENCED_PACKAGES);
+ createEReference(modelEClass, MODEL__MISSING_PACKAGES);
+
+ evolutionEClass = createEClass(EVOLUTION);
+ createEAttribute(evolutionEClass, EVOLUTION__USE_ECORE_PACKAGE);
+ createEAttribute(evolutionEClass, EVOLUTION__USE_ERESOURCE_PACKAGE);
+ createEAttribute(evolutionEClass, EVOLUTION__USE_ETYPES_PACKAGE);
+ createEAttribute(evolutionEClass, EVOLUTION__UNIQUE_NAMESPACES);
+ createEReference(evolutionEClass, EVOLUTION__MODELS);
+ createEReference(evolutionEClass, EVOLUTION__ROOT_PACKAGES);
+ createEReference(evolutionEClass, EVOLUTION__ALL_PACKAGES);
+ createEReference(evolutionEClass, EVOLUTION__MISSING_PACKAGES);
+ createEReference(evolutionEClass, EVOLUTION__RELEASES);
+ createEReference(evolutionEClass, EVOLUTION__ORDERED_RELEASES);
+ createEReference(evolutionEClass, EVOLUTION__LATEST_RELEASE);
+ createEAttribute(evolutionEClass, EVOLUTION__NEXT_RELEASE_VERSION);
+ createEOperation(evolutionEClass, EVOLUTION___GET_RELEASE__INT);
+
+ releaseEClass = createEClass(RELEASE);
+ createEReference(releaseEClass, RELEASE__EVOLUTION);
+ createEAttribute(releaseEClass, RELEASE__VERSION);
+ createEAttribute(releaseEClass, RELEASE__DATE);
+ createEReference(releaseEClass, RELEASE__NEXT_RELEASE);
+ createEReference(releaseEClass, RELEASE__PREVIOUS_RELEASE);
+ createEReference(releaseEClass, RELEASE__ROOT_PACKAGES);
+ createEReference(releaseEClass, RELEASE__ALL_PACKAGES);
+
+ changeEClass = createEClass(CHANGE);
+ createEReference(changeEClass, CHANGE__PARENT);
+ createEReference(changeEClass, CHANGE__CHILDREN);
+ createEOperation(changeEClass, CHANGE___GET_MODEL_SET_CHANGE);
+ createEOperation(changeEClass, CHANGE___GET_OLD_ELEMENT_FOR__EMODELELEMENT);
+ createEOperation(changeEClass, CHANGE___GET_NEW_ELEMENTS_FOR__EMODELELEMENT);
+ createEOperation(changeEClass, CHANGE___GET_OLD_MODEL_SET);
+ createEOperation(changeEClass, CHANGE___GET_NEW_MODEL_SET);
+
+ modelSetChangeEClass = createEClass(MODEL_SET_CHANGE);
+ createEReference(modelSetChangeEClass, MODEL_SET_CHANGE__OLD_MODEL_SET);
+ createEReference(modelSetChangeEClass, MODEL_SET_CHANGE__NEW_MODEL_SET);
+
+ elementChangeEClass = createEClass(ELEMENT_CHANGE);
+ createEReference(elementChangeEClass, ELEMENT_CHANGE__OLD_ELEMENT);
+ createEReference(elementChangeEClass, ELEMENT_CHANGE__NEW_ELEMENT);
+ createEAttribute(elementChangeEClass, ELEMENT_CHANGE__KIND);
+ createEOperation(elementChangeEClass, ELEMENT_CHANGE___GET_ELEMENT);
+
+ propertyChangeEClass = createEClass(PROPERTY_CHANGE);
+ createEReference(propertyChangeEClass, PROPERTY_CHANGE__FEATURE);
+ createEAttribute(propertyChangeEClass, PROPERTY_CHANGE__OLD_VALUE);
+ createEAttribute(propertyChangeEClass, PROPERTY_CHANGE__NEW_VALUE);
+ createEAttribute(propertyChangeEClass, PROPERTY_CHANGE__KIND);
+
+ migrationEClass = createEClass(MIGRATION);
+ createEReference(migrationEClass, MIGRATION__MODEL_SET);
+ createEAttribute(migrationEClass, MIGRATION__DIAGNOSTIC_ID);
+
+ featurePathMigrationEClass = createEClass(FEATURE_PATH_MIGRATION);
+ createEReference(featurePathMigrationEClass, FEATURE_PATH_MIGRATION__FROM_CLASS);
+ createEReference(featurePathMigrationEClass, FEATURE_PATH_MIGRATION__TO_CLASS);
+ createEReference(featurePathMigrationEClass, FEATURE_PATH_MIGRATION__FEATURE_PATH);
+
+ // Create enums
+ changeKindEEnum = createEEnum(CHANGE_KIND);
+
+ // Create data types
+ uriEDataType = createEDataType(URI);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ *
+ *
+ * @generated
+ */
+ public void initializePackageContents()
+ {
+ if (isInitialized)
+ {
+ return;
+ }
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ evolutionEClass.getESuperTypes().add(getModelSet());
+ releaseEClass.getESuperTypes().add(getModelSet());
+ modelSetChangeEClass.getESuperTypes().add(getChange());
+ elementChangeEClass.getESuperTypes().add(getChange());
+ propertyChangeEClass.getESuperTypes().add(getChange());
+ featurePathMigrationEClass.getESuperTypes().add(getMigration());
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(modelSetEClass, ModelSet.class, "ModelSet", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getModelSet_Change(), getModelSetChange(), null, "change", null, 0, 1, ModelSet.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
+ IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getModelSet_Migrations(), getMigration(), getMigration_ModelSet(), "migrations", null, 0, -1, ModelSet.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEOperation(getModelSet__GetEvolution(), getEvolution(), "getEvolution", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEOperation(getModelSet__GetVersion(), ecorePackage.getEInt(), "getVersion", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEOperation(getModelSet__GetPreviousRelease(), getRelease(), "getPreviousRelease", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEOperation(getModelSet__GetRootPackages(), ecorePackage.getEPackage(), "getRootPackages", 0, -1, IS_UNIQUE, IS_ORDERED);
+
+ initEOperation(getModelSet__GetAllPackages(), ecorePackage.getEPackage(), "getAllPackages", 0, -1, IS_UNIQUE, IS_ORDERED);
+
+ EOperation op = initEOperation(getModelSet__ContainsElement__EModelElement(), theEcorePackage.getEBoolean(), "containsElement", 0, 1, IS_UNIQUE,
+ IS_ORDERED);
+ addEParameter(op, theEcorePackage.getEModelElement(), "modelElement", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ op = initEOperation(getModelSet__GetElement__String(), null, "getElement", 0, 1, IS_UNIQUE, IS_ORDERED);
+ ETypeParameter t1 = addETypeParameter(op, "T");
+ EGenericType g1 = createEGenericType(theEcorePackage.getEModelElement());
+ t1.getEBounds().add(g1);
+ addEParameter(op, theEcorePackage.getEString(), "id", 0, 1, IS_UNIQUE, IS_ORDERED);
+ g1 = createEGenericType(t1);
+ initEOperation(op, g1);
+
+ op = initEOperation(getModelSet__GetElementID__EModelElement(), theEcorePackage.getEString(), "getElementID", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, theEcorePackage.getEModelElement(), "modelElement", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ op = initEOperation(getModelSet__GetElementID__EModelElement_boolean(), theEcorePackage.getEString(), "getElementID", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, theEcorePackage.getEModelElement(), "modelElement", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, ecorePackage.getEBoolean(), "considerOldIDs", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ op = initEOperation(getModelSet__Compare__ModelSet(), getModelSetChange(), "compare", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, getModelSet(), "other", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ op = initEOperation(getModelSet__GetMigration__String(), getMigration(), "getMigration", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, ecorePackage.getEString(), "diagnosticID", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getModel_Evolution(), getEvolution(), getEvolution_Models(), "evolution", null, 1, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_URI(), getURI(), "uRI", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_RootPackage(), theEcorePackage.getEPackage(), null, "rootPackage", null, 0, 1, Model.class, IS_TRANSIENT, IS_VOLATILE,
+ !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_AllPackages(), theEcorePackage.getEPackage(), null, "allPackages", null, 0, -1, Model.class, IS_TRANSIENT, IS_VOLATILE,
+ !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_ReferencedPackages(), theEcorePackage.getEPackage(), null, "referencedPackages", null, 0, -1, Model.class, IS_TRANSIENT,
+ IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_MissingPackages(), theEcorePackage.getEPackage(), null, "missingPackages", null, 0, -1, Model.class, IS_TRANSIENT, IS_VOLATILE,
+ !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+
+ initEClass(evolutionEClass, Evolution.class, "Evolution", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getEvolution_UseEcorePackage(), ecorePackage.getEBoolean(), "useEcorePackage", "true", 0, 1, Evolution.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getEvolution_UseEresourcePackage(), ecorePackage.getEBoolean(), "useEresourcePackage", null, 0, 1, Evolution.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getEvolution_UseEtypesPackage(), ecorePackage.getEBoolean(), "useEtypesPackage", null, 0, 1, Evolution.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getEvolution_UniqueNamespaces(), ecorePackage.getEBoolean(), "uniqueNamespaces", "true", 0, 1, Evolution.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getEvolution_Models(), getModel(), getModel_Evolution(), "models", null, 0, -1, Evolution.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
+ IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getEvolution_RootPackages(), theEcorePackage.getEPackage(), null, "rootPackages", null, 0, -1, Evolution.class, IS_TRANSIENT, IS_VOLATILE,
+ !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getEvolution_AllPackages(), theEcorePackage.getEPackage(), null, "allPackages", null, 0, -1, Evolution.class, IS_TRANSIENT, IS_VOLATILE,
+ !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getEvolution_MissingPackages(), theEcorePackage.getEPackage(), null, "missingPackages", null, 0, -1, Evolution.class, IS_TRANSIENT,
+ IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getEvolution_Releases(), getRelease(), getRelease_Evolution(), "releases", null, 0, -1, Evolution.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getEvolution_OrderedReleases(), getRelease(), null, "orderedReleases", null, 0, -1, Evolution.class, IS_TRANSIENT, IS_VOLATILE,
+ !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getEvolution_LatestRelease(), getRelease(), null, "latestRelease", null, 0, 1, Evolution.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE,
+ !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEAttribute(getEvolution_NextReleaseVersion(), theEcorePackage.getEInt(), "nextReleaseVersion", null, 0, 1, Evolution.class, IS_TRANSIENT, IS_VOLATILE,
+ !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+
+ op = initEOperation(getEvolution__GetRelease__int(), getRelease(), "getRelease", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, theEcorePackage.getEInt(), "version", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEClass(releaseEClass, Release.class, "Release", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getRelease_Evolution(), getEvolution(), getEvolution_Releases(), "evolution", null, 1, 1, Release.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getRelease_Version(), ecorePackage.getEInt(), "version", null, 1, 1, Release.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
+ !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getRelease_Date(), ecorePackage.getEDate(), "date", null, 1, 1, Release.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE,
+ !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getRelease_NextRelease(), getRelease(), null, "nextRelease", null, 0, 1, Release.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE,
+ !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getRelease_PreviousRelease(), getRelease(), null, "previousRelease", null, 0, 1, Release.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE,
+ !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getRelease_RootPackages(), theEcorePackage.getEPackage(), null, "rootPackages", null, 0, -1, Release.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getRelease_AllPackages(), theEcorePackage.getEPackage(), null, "allPackages", null, 0, -1, Release.class, IS_TRANSIENT, IS_VOLATILE,
+ !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+
+ initEClass(changeEClass, Change.class, "Change", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getChange_Parent(), getChange(), getChange_Children(), "parent", null, 0, 1, Change.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
+ !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getChange_Children(), getChange(), getChange_Parent(), "children", null, 0, -1, Change.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
+ IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEOperation(getChange__GetModelSetChange(), getModelSetChange(), "getModelSetChange", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ op = initEOperation(getChange__GetOldElementFor__EModelElement(), theEcorePackage.getEModelElement(), "getOldElementFor", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, theEcorePackage.getEModelElement(), "newElement", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ op = initEOperation(getChange__GetNewElementsFor__EModelElement(), theEcorePackage.getEModelElement(), "getNewElementsFor", 0, -1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, theEcorePackage.getEModelElement(), "oldElement", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEOperation(getChange__GetOldModelSet(), getModelSet(), "getOldModelSet", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEOperation(getChange__GetNewModelSet(), getModelSet(), "getNewModelSet", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEClass(modelSetChangeEClass, ModelSetChange.class, "ModelSetChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getModelSetChange_OldModelSet(), getModelSet(), null, "oldModelSet", null, 0, 1, ModelSetChange.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModelSetChange_NewModelSet(), getModelSet(), null, "newModelSet", null, 0, 1, ModelSetChange.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(elementChangeEClass, ElementChange.class, "ElementChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getElementChange_OldElement(), theEcorePackage.getEModelElement(), null, "oldElement", null, 0, 1, ElementChange.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getElementChange_NewElement(), theEcorePackage.getEModelElement(), null, "newElement", null, 0, 1, ElementChange.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getElementChange_Kind(), getChangeKind(), "kind", null, 0, 1, ElementChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
+ !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEOperation(getElementChange__GetElement(), theEcorePackage.getEModelElement(), "getElement", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEClass(propertyChangeEClass, PropertyChange.class, "PropertyChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getPropertyChange_Feature(), theEcorePackage.getEStructuralFeature(), null, "feature", null, 0, 1, PropertyChange.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPropertyChange_OldValue(), ecorePackage.getEJavaObject(), "oldValue", null, 0, 1, PropertyChange.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPropertyChange_NewValue(), ecorePackage.getEJavaObject(), "newValue", null, 0, 1, PropertyChange.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPropertyChange_Kind(), getChangeKind(), "kind", null, 0, 1, PropertyChange.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE,
+ !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+
+ initEClass(migrationEClass, Migration.class, "Migration", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getMigration_ModelSet(), getModelSet(), getModelSet_Migrations(), "modelSet", null, 0, 1, Migration.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMigration_DiagnosticID(), ecorePackage.getEString(), "diagnosticID", null, 0, 1, Migration.class, !IS_TRANSIENT, !IS_VOLATILE,
+ IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(featurePathMigrationEClass, FeaturePathMigration.class, "FeaturePathMigration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getFeaturePathMigration_FromClass(), ecorePackage.getEClass(), null, "fromClass", null, 1, 1, FeaturePathMigration.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getFeaturePathMigration_ToClass(), ecorePackage.getEClass(), null, "toClass", null, 1, 1, FeaturePathMigration.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getFeaturePathMigration_FeaturePath(), ecorePackage.getEReference(), null, "featurePath", null, 0, -1, FeaturePathMigration.class,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Initialize enums and add enum literals
+ initEEnum(changeKindEEnum, ChangeKind.class, "ChangeKind");
+ addEEnumLiteral(changeKindEEnum, ChangeKind.NONE);
+ addEEnumLiteral(changeKindEEnum, ChangeKind.CHANGED);
+ addEEnumLiteral(changeKindEEnum, ChangeKind.REMOVED);
+ addEEnumLiteral(changeKindEEnum, ChangeKind.ADDED);
+ addEEnumLiteral(changeKindEEnum, ChangeKind.COPIED);
+ addEEnumLiteral(changeKindEEnum, ChangeKind.MOVED);
+
+ // Initialize data types
+ initEDataType(uriEDataType, org.eclipse.emf.common.util.URI.class, "URI", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+
+ // Create resource
+ createResource(eNS_URI);
+
+ // Create annotations
+ // http://www.eclipse.org/emf/2002/Ecore
+ createEcoreAnnotations();
+ // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
+ createExtendedMetaDataAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for http://www.eclipse.org/emf/2002/Ecore.
+ *
+ *
+ * @generated
+ */
+ protected void createEcoreAnnotations()
+ {
+ String source = "http://www.eclipse.org/emf/2002/Ecore";
+ addAnnotation(modelEClass, source, new String[] { "constraints", "ModelLoaded IDs_Exist NamespaceReflectsChange" });
+ addAnnotation(evolutionEClass, source, new String[] { "constraints", "NotEmpty PackagesUnique NoMissingPackages IDsUnique" });
+ addAnnotation(elementChangeEClass, source, new String[] { "constraints", "FeaturePathIsKnown" });
+ addAnnotation(migrationEClass, source, new String[] { "constraints", "NotObsolete" });
+ addAnnotation(featurePathMigrationEClass, source, new String[] { "constraints", "NewFeatureReachable" });
+ }
+
+ /**
+ * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData.
+ *
+ *
+ * @generated
+ */
+ protected void createExtendedMetaDataAnnotations()
+ {
+ String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
+ addAnnotation(getModel_URI(), source, new String[] { "kind", "attribute", "name", "uri" });
+ }
+
+} // EvolutionPackageImpl
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionPlugin.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionPlugin.java
new file mode 100644
index 0000000000..9f831d2a44
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionPlugin.java
@@ -0,0 +1,92 @@
+/**
+ */
+package org.eclipse.emf.cdo.evolution.impl;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
+
+/**
+ * This is the central singleton for the Evolution model plugin.
+ *
+ *
+ * @generated
+ */
+public final class EvolutionPlugin extends EMFPlugin
+{
+ /**
+ * Keep track of the singleton.
+ *
+ *
+ * @generated
+ */
+ public static final EvolutionPlugin INSTANCE = new EvolutionPlugin();
+
+ /**
+ * Keep track of the singleton.
+ *
+ *
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ *
+ *
+ * @generated
+ */
+ public EvolutionPlugin()
+ {
+ super(new ResourceLocator[] {});
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ *
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator()
+ {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ *
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin()
+ {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse Plugin.
+ *
+ *
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin
+ {
+ /**
+ * Creates an instance.
+ *
+ *
+ * @generated
+ */
+ public Implementation()
+ {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/FeaturePathMigrationImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/FeaturePathMigrationImpl.java
new file mode 100644
index 0000000000..48239adeaa
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/FeaturePathMigrationImpl.java
@@ -0,0 +1,220 @@
+/**
+ */
+package org.eclipse.emf.cdo.evolution.impl;
+
+import org.eclipse.emf.cdo.evolution.EvolutionPackage;
+import org.eclipse.emf.cdo.evolution.FeaturePathMigration;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+
+import java.util.Collection;
+
+/**
+ *
+ * An implementation of the model object 'Feature Path Migration'.
+ *
+ *
+ * The following features are implemented:
+ *
+ *
+ * - {@link org.eclipse.emf.cdo.evolution.impl.FeaturePathMigrationImpl#getFromClass From Class}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.FeaturePathMigrationImpl#getToClass To Class}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.FeaturePathMigrationImpl#getFeaturePath Feature Path}
+ *
+ *
+ * @generated
+ */
+public class FeaturePathMigrationImpl extends MigrationImpl implements FeaturePathMigration
+{
+ /**
+ *
+ *
+ * @generated
+ */
+ protected FeaturePathMigrationImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return EvolutionPackage.Literals.FEATURE_PATH_MIGRATION;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getFromClass()
+ {
+ return (EClass)eDynamicGet(EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__FROM_CLASS, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass basicGetFromClass()
+ {
+ return (EClass)eDynamicGet(EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__FROM_CLASS, false, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setFromClass(EClass newFromClass)
+ {
+ eDynamicSet(EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__FROM_CLASS, newFromClass);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getToClass()
+ {
+ return (EClass)eDynamicGet(EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__TO_CLASS, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass basicGetToClass()
+ {
+ return (EClass)eDynamicGet(EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__TO_CLASS, false, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setToClass(EClass newToClass)
+ {
+ eDynamicSet(EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__TO_CLASS, newToClass);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ public EList getFeaturePath()
+ {
+ return (EList)eDynamicGet(EvolutionPackage.FEATURE_PATH_MIGRATION__FEATURE_PATH, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__FEATURE_PATH,
+ true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS:
+ if (resolve)
+ {
+ return getFromClass();
+ }
+ return basicGetFromClass();
+ case EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS:
+ if (resolve)
+ {
+ return getToClass();
+ }
+ return basicGetToClass();
+ case EvolutionPackage.FEATURE_PATH_MIGRATION__FEATURE_PATH:
+ return getFeaturePath();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS:
+ setFromClass((EClass)newValue);
+ return;
+ case EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS:
+ setToClass((EClass)newValue);
+ return;
+ case EvolutionPackage.FEATURE_PATH_MIGRATION__FEATURE_PATH:
+ getFeaturePath().clear();
+ getFeaturePath().addAll((Collection extends EReference>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS:
+ setFromClass((EClass)null);
+ return;
+ case EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS:
+ setToClass((EClass)null);
+ return;
+ case EvolutionPackage.FEATURE_PATH_MIGRATION__FEATURE_PATH:
+ getFeaturePath().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS:
+ return basicGetFromClass() != null;
+ case EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS:
+ return basicGetToClass() != null;
+ case EvolutionPackage.FEATURE_PATH_MIGRATION__FEATURE_PATH:
+ return !getFeaturePath().isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+} // FeaturePathMigrationImpl
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/MigrationImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/MigrationImpl.java
new file mode 100644
index 0000000000..5f37be483b
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/MigrationImpl.java
@@ -0,0 +1,252 @@
+/**
+ */
+package org.eclipse.emf.cdo.evolution.impl;
+
+import org.eclipse.emf.cdo.evolution.EvolutionPackage;
+import org.eclipse.emf.cdo.evolution.Migration;
+import org.eclipse.emf.cdo.evolution.ModelSet;
+
+import org.eclipse.emf.internal.cdo.CDOObjectImpl;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+/**
+ *
+ * An implementation of the model object 'Migration'.
+ *
+ *
+ * The following features are implemented:
+ *
+ *
+ * - {@link org.eclipse.emf.cdo.evolution.impl.MigrationImpl#getModelSet Model Set}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.MigrationImpl#getDiagnosticID Diagnostic ID}
+ *
+ *
+ * @generated
+ */
+public abstract class MigrationImpl extends CDOObjectImpl implements Migration
+{
+ /**
+ * The default value of the '{@link #getDiagnosticID() Diagnostic ID}' attribute.
+ *
+ *
+ * @see #getDiagnosticID()
+ * @generated
+ * @ordered
+ */
+ protected static final String DIAGNOSTIC_ID_EDEFAULT = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected MigrationImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return EvolutionPackage.Literals.MIGRATION;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public ModelSet getModelSet()
+ {
+ return (ModelSet)eDynamicGet(EvolutionPackage.MIGRATION__MODEL_SET, EvolutionPackage.Literals.MIGRATION__MODEL_SET, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public NotificationChain basicSetModelSet(ModelSet newModelSet, NotificationChain msgs)
+ {
+ msgs = eBasicSetContainer((InternalEObject)newModelSet, EvolutionPackage.MIGRATION__MODEL_SET, msgs);
+ return msgs;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setModelSet(ModelSet newModelSet)
+ {
+ eDynamicSet(EvolutionPackage.MIGRATION__MODEL_SET, EvolutionPackage.Literals.MIGRATION__MODEL_SET, newModelSet);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getDiagnosticID()
+ {
+ return (String)eDynamicGet(EvolutionPackage.MIGRATION__DIAGNOSTIC_ID, EvolutionPackage.Literals.MIGRATION__DIAGNOSTIC_ID, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setDiagnosticID(String newDiagnosticID)
+ {
+ eDynamicSet(EvolutionPackage.MIGRATION__DIAGNOSTIC_ID, EvolutionPackage.Literals.MIGRATION__DIAGNOSTIC_ID, newDiagnosticID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MIGRATION__MODEL_SET:
+ if (eInternalContainer() != null)
+ {
+ msgs = eBasicRemoveFromContainer(msgs);
+ }
+ return basicSetModelSet((ModelSet)otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MIGRATION__MODEL_SET:
+ return basicSetModelSet(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs)
+ {
+ switch (eContainerFeatureID())
+ {
+ case EvolutionPackage.MIGRATION__MODEL_SET:
+ return eInternalContainer().eInverseRemove(this, EvolutionPackage.MODEL_SET__MIGRATIONS, ModelSet.class, msgs);
+ }
+ return super.eBasicRemoveFromContainerFeature(msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MIGRATION__MODEL_SET:
+ return getModelSet();
+ case EvolutionPackage.MIGRATION__DIAGNOSTIC_ID:
+ return getDiagnosticID();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MIGRATION__MODEL_SET:
+ setModelSet((ModelSet)newValue);
+ return;
+ case EvolutionPackage.MIGRATION__DIAGNOSTIC_ID:
+ setDiagnosticID((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MIGRATION__MODEL_SET:
+ setModelSet((ModelSet)null);
+ return;
+ case EvolutionPackage.MIGRATION__DIAGNOSTIC_ID:
+ setDiagnosticID(DIAGNOSTIC_ID_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MIGRATION__MODEL_SET:
+ return getModelSet() != null;
+ case EvolutionPackage.MIGRATION__DIAGNOSTIC_ID:
+ return DIAGNOSTIC_ID_EDEFAULT == null ? getDiagnosticID() != null : !DIAGNOSTIC_ID_EDEFAULT.equals(getDiagnosticID());
+ }
+ return super.eIsSet(featureID);
+ }
+
+} // MigrationImpl
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelImpl.java
new file mode 100644
index 0000000000..577b41095b
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelImpl.java
@@ -0,0 +1,567 @@
+/**
+ */
+package org.eclipse.emf.cdo.evolution.impl;
+
+import org.eclipse.emf.cdo.eresource.EresourcePackage;
+import org.eclipse.emf.cdo.etypes.EtypesPackage;
+import org.eclipse.emf.cdo.evolution.Evolution;
+import org.eclipse.emf.cdo.evolution.EvolutionPackage;
+import org.eclipse.emf.cdo.evolution.Model;
+
+import org.eclipse.emf.internal.cdo.CDOObjectImpl;
+import org.eclipse.emf.internal.cdo.util.CompletePackageClosure;
+import org.eclipse.emf.internal.cdo.util.IPackageClosure;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.ECollections;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreEList;
+
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ *
+ * An implementation of the model object 'Model'.
+ *
+ *
+ * The following features are implemented:
+ *
+ *
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ModelImpl#getEvolution Evolution}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ModelImpl#getURI URI}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ModelImpl#getRootPackage Root Package}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ModelImpl#getAllPackages All Packages}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ModelImpl#getReferencedPackages Referenced Packages}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ModelImpl#getMissingPackages Missing Packages}
+ *
+ *
+ * @generated
+ */
+public class ModelImpl extends CDOObjectImpl implements Model
+{
+ /**
+ * The default value of the '{@link #getURI() URI}' attribute.
+ *
+ *
+ * @see #getURI()
+ * @generated
+ * @ordered
+ */
+ protected static final URI URI_EDEFAULT = null;
+
+ private ModelStatus status;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected ModelImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return EvolutionPackage.Literals.MODEL;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public Evolution getEvolution()
+ {
+ return (Evolution)eDynamicGet(EvolutionPackage.MODEL__EVOLUTION, EvolutionPackage.Literals.MODEL__EVOLUTION, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public NotificationChain basicSetEvolution(Evolution newEvolution, NotificationChain msgs)
+ {
+ msgs = eBasicSetContainer((InternalEObject)newEvolution, EvolutionPackage.MODEL__EVOLUTION, msgs);
+ return msgs;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setEvolution(Evolution newEvolution)
+ {
+ eDynamicSet(EvolutionPackage.MODEL__EVOLUTION, EvolutionPackage.Literals.MODEL__EVOLUTION, newEvolution);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public URI getURI()
+ {
+ return (URI)eDynamicGet(EvolutionPackage.MODEL__URI, EvolutionPackage.Literals.MODEL__URI, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setURIGen(URI newURI)
+ {
+ eDynamicSet(EvolutionPackage.MODEL__URI, EvolutionPackage.Literals.MODEL__URI, newURI);
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public void setURI(URI newURI)
+ {
+ status = null;
+
+ EPackage oldRootPackage = null;
+ // EList oldAllPackages = null;
+ // EList oldReferencedPackages = null;
+ // EList oldMissingPackages = null;
+
+ boolean notificationRequired = eNotificationRequired();
+ if (notificationRequired)
+ {
+ oldRootPackage = getRootPackage();
+ // oldAllPackages = getAllPackages();
+ // oldReferencedPackages = getReferencedPackages();
+ // oldMissingPackages = getMissingPackages();
+ }
+
+ setURIGen(newURI);
+
+ if (notificationRequired)
+ {
+ EPackage rootPackage = getRootPackage();
+ if (rootPackage != oldRootPackage)
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, EvolutionPackage.Literals.MODEL__ROOT_PACKAGE, oldRootPackage, rootPackage));
+ }
+
+ // EList allPackages = getAllPackages();
+ // if (!allPackages.equals(oldAllPackages))
+ // {
+ // eNotify(new ENotificationImpl(this, Notification.SET, EvolutionPackage.Literals.MODEL__ALL_PACKAGES,
+ // oldAllPackages, allPackages));
+ // }
+ }
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EPackage getRootPackage()
+ {
+ EPackage rootPackage = basicGetRootPackage();
+ return rootPackage != null && rootPackage.eIsProxy() ? (EPackage)eResolveProxy((InternalEObject)rootPackage) : rootPackage;
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public EPackage basicGetRootPackage()
+ {
+ URI uri = getURI();
+ if (uri == null)
+ {
+ status = ModelStatus.NO_URI;
+ return null;
+ }
+
+ Resource resource = eResource();
+ if (resource == null)
+ {
+ status = ModelStatus.NO_RESOURCE_SET;
+ return null;
+ }
+
+ ResourceSet resourceSet = resource.getResourceSet();
+ if (resourceSet == null)
+ {
+ status = ModelStatus.NO_RESOURCE_SET;
+ return null;
+ }
+
+ if (!resourceSet.getURIConverter().exists(uri, Collections.emptyMap()))
+ {
+ status = ModelStatus.RESOURCE_NOT_FOUND;
+ return null;
+ }
+
+ Resource modelResource;
+
+ try
+ {
+ modelResource = resourceSet.getResource(uri, true);
+ }
+ catch (Exception ex)
+ {
+ // ex.printStackTrace();
+ modelResource = null;
+ }
+
+ if (modelResource == null)
+ {
+ status = ModelStatus.LOAD_PROBLEM;
+ return null;
+ }
+
+ if (!modelResource.getErrors().isEmpty())
+ {
+ status = ModelStatus.LOAD_PROBLEM;
+ resourceSet.getResources().remove(modelResource);
+ return null;
+ }
+
+ EList contents = modelResource.getContents();
+ if (contents.isEmpty())
+ {
+ status = ModelStatus.CONTENT_PROBLEM;
+ return null;
+ }
+
+ EObject firstElement = contents.get(0);
+ if (!(firstElement instanceof EPackage))
+ {
+ status = ModelStatus.CONTENT_PROBLEM;
+ return null;
+ }
+
+ status = ModelStatus.OK;
+ return (EPackage)firstElement;
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public EList getAllPackages()
+ {
+ EPackage rootPackage = getRootPackage();
+ if (rootPackage == null)
+ {
+ return ECollections.emptyEList();
+ }
+
+ EcoreEList list = new EcoreEList(EPackage.class, this)
+ {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public int getFeatureID()
+ {
+ return EvolutionPackage.MODEL__ALL_PACKAGES;
+ }
+ };
+
+ collectAllPackages(rootPackage, list);
+ return list;
+ }
+
+ static void collectAllPackages(EPackage ePackage, EList list)
+ {
+ list.add(ePackage);
+
+ for (EPackage subPackage : ePackage.getESubpackages())
+ {
+ collectAllPackages(subPackage, list);
+ }
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public EList getReferencedPackages()
+ {
+ EList allPackages = getAllPackages();
+ if (allPackages.isEmpty())
+ {
+ return ECollections.emptyEList();
+ }
+
+ EcoreEList list = new EcoreEList(EPackage.class, this)
+ {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public int getFeatureID()
+ {
+ return EvolutionPackage.MODEL__REFERENCED_PACKAGES;
+ }
+ };
+
+ IPackageClosure closure = new CompletePackageClosure();
+ Set referencedPackages = closure.calculate(allPackages);
+
+ for (EPackage referencedPackage : referencedPackages)
+ {
+ if (!allPackages.contains(referencedPackage))
+ {
+ list.add(referencedPackage);
+ }
+ }
+
+ return list;
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public EList getMissingPackages()
+ {
+ EList referencedPackages = getReferencedPackages();
+ if (referencedPackages.isEmpty())
+ {
+ return ECollections.emptyEList();
+ }
+
+ Evolution evolution = getEvolution();
+ if (evolution == null)
+ {
+ return ECollections.emptyEList();
+ }
+
+ EList allPackages = evolution.getAllPackages();
+
+ EcoreEList list = new EcoreEList(EPackage.class, this)
+ {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public int getFeatureID()
+ {
+ return EvolutionPackage.MODEL__MISSING_PACKAGES;
+ }
+ };
+
+ for (EPackage referencedPackage : referencedPackages)
+ {
+ if (referencedPackage == EcorePackage.eINSTANCE && evolution.isUseEcorePackage())
+ {
+ continue;
+ }
+
+ if (referencedPackage == EresourcePackage.eINSTANCE && evolution.isUseEresourcePackage())
+ {
+ continue;
+ }
+
+ if (referencedPackage == EtypesPackage.eINSTANCE && evolution.isUseEtypesPackage())
+ {
+ continue;
+ }
+
+ if (allPackages.contains(referencedPackage))
+ {
+ continue;
+ }
+
+ list.add(referencedPackage);
+ }
+
+ return list;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL__EVOLUTION:
+ if (eInternalContainer() != null)
+ {
+ msgs = eBasicRemoveFromContainer(msgs);
+ }
+ return basicSetEvolution((Evolution)otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL__EVOLUTION:
+ return basicSetEvolution(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs)
+ {
+ switch (eContainerFeatureID())
+ {
+ case EvolutionPackage.MODEL__EVOLUTION:
+ return eInternalContainer().eInverseRemove(this, EvolutionPackage.EVOLUTION__MODELS, Evolution.class, msgs);
+ }
+ return super.eBasicRemoveFromContainerFeature(msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL__EVOLUTION:
+ return getEvolution();
+ case EvolutionPackage.MODEL__URI:
+ return getURI();
+ case EvolutionPackage.MODEL__ROOT_PACKAGE:
+ if (resolve)
+ {
+ return getRootPackage();
+ }
+ return basicGetRootPackage();
+ case EvolutionPackage.MODEL__ALL_PACKAGES:
+ return getAllPackages();
+ case EvolutionPackage.MODEL__REFERENCED_PACKAGES:
+ return getReferencedPackages();
+ case EvolutionPackage.MODEL__MISSING_PACKAGES:
+ return getMissingPackages();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL__EVOLUTION:
+ setEvolution((Evolution)newValue);
+ return;
+ case EvolutionPackage.MODEL__URI:
+ setURI((URI)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL__EVOLUTION:
+ setEvolution((Evolution)null);
+ return;
+ case EvolutionPackage.MODEL__URI:
+ setURI(URI_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL__EVOLUTION:
+ return getEvolution() != null;
+ case EvolutionPackage.MODEL__URI:
+ return URI_EDEFAULT == null ? getURI() != null : !URI_EDEFAULT.equals(getURI());
+ case EvolutionPackage.MODEL__ROOT_PACKAGE:
+ return basicGetRootPackage() != null;
+ case EvolutionPackage.MODEL__ALL_PACKAGES:
+ return !getAllPackages().isEmpty();
+ case EvolutionPackage.MODEL__REFERENCED_PACKAGES:
+ return !getReferencedPackages().isEmpty();
+ case EvolutionPackage.MODEL__MISSING_PACKAGES:
+ return !getMissingPackages().isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ public ModelStatus getStatus()
+ {
+ return status;
+ }
+
+} // ModelImpl
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelSetChangeImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelSetChangeImpl.java
new file mode 100644
index 0000000000..b06a02328f
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelSetChangeImpl.java
@@ -0,0 +1,276 @@
+/**
+ */
+package org.eclipse.emf.cdo.evolution.impl;
+
+import org.eclipse.emf.cdo.evolution.ElementChange;
+import org.eclipse.emf.cdo.evolution.EvolutionPackage;
+import org.eclipse.emf.cdo.evolution.ModelSet;
+import org.eclipse.emf.cdo.evolution.ModelSetChange;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EModelElement;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ *
+ * An implementation of the model object 'Model Set Change'.
+ *
+ *
+ * The following features are implemented:
+ *
+ *
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ModelSetChangeImpl#getOldModelSet Old Model Set}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ModelSetChangeImpl#getNewModelSet New Model Set}
+ *
+ *
+ * @generated
+ */
+public class ModelSetChangeImpl extends ChangeImpl implements ModelSetChange
+{
+ private final Map elementChanges = new HashMap();
+
+ private final Map newToOldElements = new HashMap();
+
+ private final Map> oldToNewElements = new HashMap>();
+
+ private final Set addedElements = new HashSet();
+
+ private final Set removedElements = new HashSet();
+
+ private ModelSet[] modelSetChain;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected ModelSetChangeImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return EvolutionPackage.Literals.MODEL_SET_CHANGE;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public ModelSet getOldModelSet()
+ {
+ return (ModelSet)eDynamicGet(EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET, EvolutionPackage.Literals.MODEL_SET_CHANGE__OLD_MODEL_SET, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public ModelSet basicGetOldModelSet()
+ {
+ return (ModelSet)eDynamicGet(EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET, EvolutionPackage.Literals.MODEL_SET_CHANGE__OLD_MODEL_SET, false, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setOldModelSet(ModelSet newOldModelSet)
+ {
+ eDynamicSet(EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET, EvolutionPackage.Literals.MODEL_SET_CHANGE__OLD_MODEL_SET, newOldModelSet);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public ModelSet getNewModelSet()
+ {
+ return (ModelSet)eDynamicGet(EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET, EvolutionPackage.Literals.MODEL_SET_CHANGE__NEW_MODEL_SET, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public ModelSet basicGetNewModelSet()
+ {
+ return (ModelSet)eDynamicGet(EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET, EvolutionPackage.Literals.MODEL_SET_CHANGE__NEW_MODEL_SET, false, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setNewModelSet(ModelSet newNewModelSet)
+ {
+ eDynamicSet(EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET, EvolutionPackage.Literals.MODEL_SET_CHANGE__NEW_MODEL_SET, newNewModelSet);
+ }
+
+ @Override
+ public ModelSetChange getModelSetChange()
+ {
+ return this;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET:
+ if (resolve)
+ {
+ return getOldModelSet();
+ }
+ return basicGetOldModelSet();
+ case EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET:
+ if (resolve)
+ {
+ return getNewModelSet();
+ }
+ return basicGetNewModelSet();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET:
+ setOldModelSet((ModelSet)newValue);
+ return;
+ case EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET:
+ setNewModelSet((ModelSet)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET:
+ setOldModelSet((ModelSet)null);
+ return;
+ case EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET:
+ setNewModelSet((ModelSet)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET:
+ return basicGetOldModelSet() != null;
+ case EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET:
+ return basicGetNewModelSet() != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ public Map getElementChanges()
+ {
+ return elementChanges;
+ }
+
+ public Map getNewToOldElements()
+ {
+ return newToOldElements;
+ }
+
+ public Map> getOldToNewElements()
+ {
+ return oldToNewElements;
+ }
+
+ public Set getAddedElements()
+ {
+ return addedElements;
+ }
+
+ public Set getRemovedElements()
+ {
+ return removedElements;
+ }
+
+ public ModelSet[] getModelSetChain()
+ {
+ return modelSetChain;
+ }
+
+ public void setModelSetChain(ModelSet[] modelSetChain)
+ {
+ this.modelSetChain = modelSetChain;
+ setOldModelSet(modelSetChain[0]);
+ setNewModelSet(modelSetChain[modelSetChain.length - 1]);
+
+ }
+
+ public Map reset()
+ {
+ Map result = new HashMap(elementChanges);
+
+ for (ElementChange elementChange : elementChanges.values())
+ {
+ elementChange.getChildren().clear();
+ }
+
+ getChildren().clear();
+ oldToNewElements.clear();
+ newToOldElements.clear();
+ addedElements.clear();
+ removedElements.clear();
+ elementChanges.clear();
+
+ return result;
+ }
+
+} // ModelSetChangeImpl
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelSetImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelSetImpl.java
new file mode 100644
index 0000000000..b7d7696a87
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelSetImpl.java
@@ -0,0 +1,937 @@
+/**
+ */
+package org.eclipse.emf.cdo.evolution.impl;
+
+import org.eclipse.emf.cdo.evolution.Change;
+import org.eclipse.emf.cdo.evolution.ChangeKind;
+import org.eclipse.emf.cdo.evolution.ElementChange;
+import org.eclipse.emf.cdo.evolution.Evolution;
+import org.eclipse.emf.cdo.evolution.EvolutionFactory;
+import org.eclipse.emf.cdo.evolution.EvolutionPackage;
+import org.eclipse.emf.cdo.evolution.Migration;
+import org.eclipse.emf.cdo.evolution.ModelSet;
+import org.eclipse.emf.cdo.evolution.ModelSetChange;
+import org.eclipse.emf.cdo.evolution.PropertyChange;
+import org.eclipse.emf.cdo.evolution.Release;
+import org.eclipse.emf.cdo.evolution.util.ElementHandler;
+import org.eclipse.emf.cdo.evolution.util.ElementRunnable;
+import org.eclipse.emf.cdo.evolution.util.IDAnnotation;
+
+import org.eclipse.emf.internal.cdo.CDOObjectImpl;
+
+import org.eclipse.net4j.util.ObjectUtil;
+import org.eclipse.net4j.util.collection.CollectionUtil;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.ECollections;
+import org.eclipse.emf.common.util.EList;
+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.InternalEObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ *
+ * An implementation of the model object 'Model Set'.
+ *
+ *
+ * The following features are implemented:
+ *
+ *
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ModelSetImpl#getChange Change}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ModelSetImpl#getMigrations Migrations}
+ *
+ *
+ * @generated
+ */
+public abstract class ModelSetImpl extends CDOObjectImpl implements ModelSet
+{
+ private static final boolean COMPARE_CONTAINMENT = false;
+
+ private static final boolean DEBUG_IDS = false;
+
+ private static final boolean DEBUG_MATCH = false;
+
+ private static final boolean DEBUG_COMPARE = false;
+
+ private static final boolean DEBUG_CLEANUP = false;
+
+ private boolean changeInvalid;
+
+ private ModelSetImpl emptyModelSet;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected ModelSetImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return EvolutionPackage.Literals.MODEL_SET;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public ModelSetChange getChangeGen()
+ {
+ return (ModelSetChange)eDynamicGet(EvolutionPackage.MODEL_SET__CHANGE, EvolutionPackage.Literals.MODEL_SET__CHANGE, true, true);
+ }
+
+ /**
+ *
+ *
+ *
+ * @generated NOT
+ */
+ public ModelSetChange getChange()
+ {
+ ModelSetChangeImpl change = (ModelSetChangeImpl)getChangeGen();
+ if (change != null && change.getOldModelSet() != getOldModelSet())
+ {
+ // Can happen after undoing a release.
+ change = null;
+ }
+
+ if (change == null || changeInvalid)
+
+ {
+ ModelSetChangeImpl result;
+ Map previousElementChanges;
+
+ if (change != null)
+ {
+ previousElementChanges = change.reset();
+ result = change;
+ }
+ else
+ {
+ ModelSet oldModelSet = getOldModelSet();
+ ModelSet[] modelSetChain = createModelSetChain(oldModelSet, this);
+
+ previousElementChanges = null;
+ result = (ModelSetChangeImpl)EvolutionFactory.eINSTANCE.createModelSetChange(modelSetChain);
+ }
+
+ compareElements(result, previousElementChanges);
+
+ try
+ {
+ eSetDeliver(false);
+ setChange(change = result);
+ }
+ finally
+ {
+ eSetDeliver(true);
+ changeInvalid = false;
+ }
+ }
+
+ return change;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public NotificationChain basicSetChange(ModelSetChange newChange, NotificationChain msgs)
+ {
+ msgs = eDynamicInverseAdd((InternalEObject)newChange, EvolutionPackage.MODEL_SET__CHANGE, msgs);
+ return msgs;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setChange(ModelSetChange newChange)
+ {
+ eDynamicSet(EvolutionPackage.MODEL_SET__CHANGE, EvolutionPackage.Literals.MODEL_SET__CHANGE, newChange);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetChange(NotificationChain msgs)
+ {
+ return eDynamicInverseRemove((InternalEObject)getChange(), EvolutionPackage.MODEL_SET__CHANGE, msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void unsetChange()
+ {
+ eDynamicUnset(EvolutionPackage.MODEL_SET__CHANGE, EvolutionPackage.Literals.MODEL_SET__CHANGE);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public boolean isSetChange()
+ {
+ return eDynamicIsSet(EvolutionPackage.MODEL_SET__CHANGE, EvolutionPackage.Literals.MODEL_SET__CHANGE);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ public EList getMigrations()
+ {
+ return (EList)eDynamicGet(EvolutionPackage.MODEL_SET__MIGRATIONS, EvolutionPackage.Literals.MODEL_SET__MIGRATIONS, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public abstract Evolution getEvolution();
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public abstract int getVersion();
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public abstract Release getPreviousRelease();
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public abstract EList getRootPackages();
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public abstract EList getAllPackages();
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public abstract boolean containsElement(EModelElement modelElement);
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ @SuppressWarnings("unchecked")
+ public T getElement(final String id)
+ {
+ // TODO Design better approach to early return from ElementHandler.execute().
+ int xxx;
+
+ class ResultException extends RuntimeException
+ {
+ private static final long serialVersionUID = 1L;
+
+ EModelElement result;
+ }
+
+ try
+ {
+ ElementHandler.execute(getRootPackages(), new ElementRunnable()
+ {
+ public void run(EModelElement modelElement)
+ {
+ if (ObjectUtil.equals(id, getElementID(modelElement)))
+ {
+ ResultException ex = new ResultException();
+ ex.result = modelElement;
+ throw ex;
+ }
+ }
+ });
+ }
+ catch (ResultException ex)
+ {
+ return (T)ex.result;
+ }
+
+ return null;
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public String getElementID(EModelElement modelElement)
+ {
+ return getElementID(modelElement, false);
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public String getElementID(EModelElement modelElement, boolean considerOldIDs)
+ {
+ if (containsElement(modelElement))
+ {
+ return IDAnnotation.getValue(modelElement, considerOldIDs);
+ }
+
+ return null;
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public ModelSetChange compare(ModelSet other)
+ {
+ ModelSet[] modelSetChain = createModelSetChain(this, other);
+ ModelSetChangeImpl result = (ModelSetChangeImpl)EvolutionFactory.eINSTANCE.createModelSetChange(modelSetChain);
+
+ compareElements(result, null);
+ return result;
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public Migration getMigration(String diagnosticID)
+ {
+ if (diagnosticID != null)
+ {
+ for (Migration migration : getMigrations())
+ {
+ if (diagnosticID.equals(migration.getDiagnosticID()))
+ {
+ return migration;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL_SET__MIGRATIONS:
+ return ((InternalEList)(InternalEList>)getMigrations()).basicAdd(otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL_SET__CHANGE:
+ return basicUnsetChange(msgs);
+ case EvolutionPackage.MODEL_SET__MIGRATIONS:
+ return ((InternalEList>)getMigrations()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL_SET__CHANGE:
+ return getChange();
+ case EvolutionPackage.MODEL_SET__MIGRATIONS:
+ return getMigrations();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL_SET__CHANGE:
+ setChange((ModelSetChange)newValue);
+ return;
+ case EvolutionPackage.MODEL_SET__MIGRATIONS:
+ getMigrations().clear();
+ getMigrations().addAll((Collection extends Migration>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL_SET__CHANGE:
+ unsetChange();
+ return;
+ case EvolutionPackage.MODEL_SET__MIGRATIONS:
+ getMigrations().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.MODEL_SET__CHANGE:
+ return isSetChange();
+ case EvolutionPackage.MODEL_SET__MIGRATIONS:
+ return !getMigrations().isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eInvoke(int operationID, EList> arguments) throws InvocationTargetException
+ {
+ switch (operationID)
+ {
+ case EvolutionPackage.MODEL_SET___GET_EVOLUTION:
+ return getEvolution();
+ case EvolutionPackage.MODEL_SET___GET_VERSION:
+ return getVersion();
+ case EvolutionPackage.MODEL_SET___GET_PREVIOUS_RELEASE:
+ return getPreviousRelease();
+ case EvolutionPackage.MODEL_SET___GET_ROOT_PACKAGES:
+ return getRootPackages();
+ case EvolutionPackage.MODEL_SET___GET_ALL_PACKAGES:
+ return getAllPackages();
+ case EvolutionPackage.MODEL_SET___CONTAINS_ELEMENT__EMODELELEMENT:
+ return containsElement((EModelElement)arguments.get(0));
+ case EvolutionPackage.MODEL_SET___GET_ELEMENT__STRING:
+ return getElement((String)arguments.get(0));
+ case EvolutionPackage.MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT:
+ return getElementID((EModelElement)arguments.get(0));
+ case EvolutionPackage.MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT_BOOLEAN:
+ return getElementID((EModelElement)arguments.get(0), (Boolean)arguments.get(1));
+ case EvolutionPackage.MODEL_SET___COMPARE__MODELSET:
+ return compare((ModelSet)arguments.get(0));
+ case EvolutionPackage.MODEL_SET___GET_MIGRATION__STRING:
+ return getMigration((String)arguments.get(0));
+ }
+ return super.eInvoke(operationID, arguments);
+ }
+
+ public void invalidateChange()
+ {
+ changeInvalid = true;
+ }
+
+ private ModelSet getOldModelSet()
+ {
+ Release previousRelease = getPreviousRelease();
+ return previousRelease != null ? previousRelease : getEmptyModelSet();
+ }
+
+ private ModelSet getEmptyModelSet()
+ {
+ if (emptyModelSet == null)
+ {
+ emptyModelSet = new ModelSetImpl()
+ {
+ @Override
+ public int getVersion()
+ {
+ return 0;
+ }
+
+ @Override
+ public EList getRootPackages()
+ {
+ return ECollections.emptyEList();
+ }
+
+ @Override
+ public Release getPreviousRelease()
+ {
+ return null;
+ }
+
+ @Override
+ public Evolution getEvolution()
+ {
+ return ModelSetImpl.this.getEvolution();
+ }
+
+ @Override
+ public EList getAllPackages()
+ {
+ return ECollections.emptyEList();
+ }
+
+ @Override
+ public boolean containsElement(EModelElement modelElement)
+ {
+ return false;
+ }
+ };
+ }
+
+ return emptyModelSet;
+ }
+
+ private static void compareElements(final ModelSetChangeImpl result, final Map previousElementChanges)
+ {
+ final ModelSet[] modelSets = result.getModelSetChain();
+ final ModelSet oldModelSet = result.getOldModelSet();
+ final ModelSet newModelSet = result.getNewModelSet();
+
+ ElementHandler.execute(newModelSet.getRootPackages(), new ElementRunnable()
+ {
+ public void run(EModelElement newElement)
+ {
+ EModelElement oldElement = newElement;
+
+ for (int i = modelSets.length - 1; i > 0; --i)
+ {
+ String id = modelSets[i].getElementID(oldElement, true);
+ oldElement = modelSets[i - 1].getElement(id);
+ if (oldElement == null)
+ {
+ break;
+ }
+ }
+
+ if (oldElement != null)
+ {
+ String newID = IDAnnotation.getValue(newElement);
+ String oldID = IDAnnotation.getValue(oldElement);
+
+ ChangeKind kind = ObjectUtil.equals(newID, oldID) ? ChangeKind.NONE : ChangeKind.COPIED;
+ if (kind == ChangeKind.COPIED)
+ {
+ if (newModelSet.getElement(oldID) == null)
+ {
+ kind = ChangeKind.MOVED;
+ }
+ }
+
+ if (DEBUG_MATCH)
+ {
+ System.out.println(kind + " " + getLabel(oldElement) + " --> " + getLabel(newElement));
+ }
+
+ ElementChange elementChange = getElementChange(newElement, oldElement, kind, previousElementChanges);
+ getParentChange(elementChange, result).getChildren().add(elementChange);
+ result.getElementChanges().put(oldElement, elementChange);
+ result.getElementChanges().put(newElement, elementChange);
+ result.getNewToOldElements().put(newElement, oldElement);
+ CollectionUtil.add(result.getOldToNewElements(), oldElement, newElement);
+ }
+ else
+ {
+ if (DEBUG_MATCH)
+ {
+ System.out.println("ADDED " + getLabel(newElement));
+ }
+
+ ElementChange elementChange = getElementChange(null, newElement, ChangeKind.ADDED, previousElementChanges);
+ getParentChange(elementChange, result).getChildren().add(elementChange);
+ result.getElementChanges().put(newElement, elementChange);
+ result.getAddedElements().add(newElement);
+ }
+ }
+ });
+
+ ElementHandler.execute(oldModelSet.getRootPackages(), new ElementRunnable()
+ {
+ public void run(EModelElement oldElement)
+ {
+ if (isRemoved(oldElement))
+ {
+ if (DEBUG_MATCH)
+ {
+ System.out.println("REMOVED " + getLabel(oldElement));
+ }
+
+ ElementChange elementChange = getElementChange(oldElement, null, ChangeKind.REMOVED, previousElementChanges);
+ getParentChange(elementChange, result).getChildren().add(elementChange);
+ result.getElementChanges().put(oldElement, elementChange);
+ result.getRemovedElements().add(oldElement);
+ }
+ }
+
+ private boolean isRemoved(EModelElement oldElement)
+ {
+ Set newElements = result.getOldToNewElements().get(oldElement);
+ if (newElements == null || newElements.isEmpty())
+ {
+ return true;
+ }
+
+ String oldID = oldModelSet.getElementID(oldElement);
+ for (EModelElement newElement : newElements)
+ {
+ String newID = newModelSet.getElementID(newElement);
+ if (ObjectUtil.equals(newID, oldID))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ });
+
+ for (Map.Entry entry : result.getNewToOldElements().entrySet())
+ {
+ EModelElement newElement = entry.getKey();
+ EModelElement oldElement = entry.getValue();
+
+ compareProperties(result, newElement, oldElement);
+ }
+
+ for (EModelElement newElement : result.getAddedElements())
+ {
+ compareProperties(result, newElement, null);
+ }
+
+ cleanupChanges(result);
+ }
+
+ private static void compareProperties(ModelSetChange result, EModelElement newElement, EModelElement oldElement)
+ {
+ EClass eClass = newElement.eClass();
+
+ if (oldElement == null)
+ {
+ oldElement = (EModelElement)EcoreUtil.create(eClass);
+ }
+ else if (oldElement.eClass() != eClass)
+ {
+ int xxx;
+ throw new IllegalArgumentException();
+ }
+
+ Map newToOldElements = result.getNewToOldElements();
+
+ for (EStructuralFeature feature : eClass.getEAllStructuralFeatures())
+ {
+ if (feature.isDerived())
+ {
+ continue;
+ }
+
+ if (feature == EcorePackage.Literals.EPACKAGE__EFACTORY_INSTANCE)
+ {
+ continue;
+ }
+
+ if (feature == EcorePackage.Literals.EENUM_LITERAL__INSTANCE)
+ {
+ continue;
+ }
+
+ EReference eReference = feature instanceof EReference ? (EReference)feature : null;
+ if (COMPARE_CONTAINMENT)
+ {
+ if (feature == EcorePackage.Literals.EMODEL_ELEMENT__EANNOTATIONS)
+ {
+ continue;
+ }
+
+ if (feature == EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE)
+ {
+ continue;
+ }
+
+ if (feature == EcorePackage.Literals.ECLASS__EGENERIC_SUPER_TYPES)
+ {
+ continue;
+ }
+ }
+ else
+ {
+ if (eReference != null && eReference.isContainment())
+ {
+ continue;
+ }
+ }
+
+ Object newValue = newElement.eGet(feature);
+ if (eReference != null)
+ {
+ if (eReference.isMany())
+ {
+ @SuppressWarnings("unchecked")
+ EList list = (EList)newValue;
+
+ // TODO As an optimization, defer list creation.
+ EList newList = new BasicEList(list.size());
+
+ for (EObject eObject : list)
+ {
+ if (eObject instanceof EModelElement)
+ {
+ EModelElement newListElement = (EModelElement)eObject;
+ EModelElement oldListElement = newToOldElements.get(newListElement);
+ if (oldListElement != null && oldListElement != newListElement)
+ {
+ eObject = oldListElement;
+ }
+ }
+
+ newList.add(eObject);
+ }
+
+ newValue = newList;
+ }
+ else
+ {
+ if (newValue instanceof EModelElement)
+ {
+ EModelElement oldValue = newToOldElements.get(newValue);
+ if (oldValue != null && oldValue != newValue)
+ {
+ newValue = oldValue;
+ }
+ }
+ }
+ }
+
+ Object oldValue = oldElement.eGet(feature);
+ if (!ObjectUtil.equals(newValue, oldValue))
+ {
+ if (DEBUG_COMPARE)
+ {
+ System.out.println("PROPERTY CHANGE " + getLabel(newElement) + " --> " + feature.getName());
+ }
+
+ PropertyChange propertyChange = EvolutionFactory.eINSTANCE.createPropertyChange(feature, oldValue, newValue);
+ ElementChange elementChange = result.getElementChanges().get(newElement);
+ elementChange.getChildren().add(0, propertyChange);
+ }
+ }
+ }
+
+ private static void cleanupChanges(Change change)
+ {
+ for (Iterator it = change.getChildren().iterator(); it.hasNext();)
+ {
+ Change child = it.next();
+ if (child instanceof ElementChange)
+ {
+ ElementChange elementChange = (ElementChange)child;
+ cleanupChanges(elementChange);
+
+ if (elementChange.getKind() == ChangeKind.NONE && elementChange.getChildren().isEmpty())
+ {
+ if (DEBUG_CLEANUP)
+ {
+ System.out.println("CLEANUP " + getLabel(elementChange.getElement()));
+ }
+
+ it.remove();
+ }
+ }
+ }
+ }
+
+ private static Change getParentChange(ElementChange elementChange, ModelSetChange modelSetChange)
+ {
+ EModelElement element = elementChange.getElement();
+ EObject eContainer = element.eContainer();
+ if (eContainer instanceof EModelElement)
+ {
+ EModelElement parentElement = (EModelElement)eContainer;
+ ElementChange parentChange = modelSetChange.getElementChanges().get(parentElement);
+ if (parentChange != null)
+ {
+ return parentChange;
+ }
+ }
+
+ return modelSetChange;
+ }
+
+ private static ElementChange getElementChange(EModelElement newElement, EModelElement oldElement, ChangeKind kind,
+ Map previousElementChanges)
+ {
+ if (previousElementChanges != null)
+ {
+ ElementChangeImpl elementChange = (ElementChangeImpl)previousElementChanges.remove(newElement);
+ if (elementChange == null)
+ {
+ elementChange = (ElementChangeImpl)previousElementChanges.remove(oldElement);
+ }
+
+ if (elementChange != null)
+ {
+ // Make sure that the ElementChange can't be used later through any other lookup.
+ for (Iterator> it = previousElementChanges.entrySet().iterator(); it.hasNext();)
+ {
+ Map.Entry entry = it.next();
+ if (entry.getValue() == elementChange)
+ {
+ it.remove();
+ }
+ }
+
+ elementChange.setOldElement(oldElement);
+ elementChange.setNewElement(newElement);
+ elementChange.setKind(kind);
+ return elementChange;
+ }
+ }
+
+ return EvolutionFactory.eINSTANCE.createElementChange(oldElement, newElement, kind);
+ }
+
+ private static String getLabel(EModelElement element)
+ {
+ String label = ElementHandler.getLabel(element);
+
+ if (DEBUG_IDS)
+ {
+ String id = IDAnnotation.getValue(element);
+ if (id != null)
+ {
+ label += "[" + id + "]";
+ }
+ }
+
+ return label;
+ }
+
+ private static ModelSet[] createModelSetChain(ModelSet modelSetA, ModelSet modelSetB)
+ {
+ int versionA = modelSetA.getVersion();
+ int versionB = modelSetB.getVersion();
+
+ EList result = new BasicEList();
+ if (versionA < versionB)
+ {
+ result.add(modelSetA);
+ result.add(modelSetB);
+ }
+ else
+ {
+ result.add(modelSetB);
+ result.add(modelSetA);
+ }
+
+ ModelSet first = result.get(0);
+ ModelSet second;
+ while ((second = result.get(1).getPreviousRelease()) != first)
+ {
+ if (second == null)
+ {
+ break;
+ }
+
+ result.add(1, second);
+ }
+
+ return result.toArray(new ModelSet[result.size()]);
+ }
+
+} // ModelSetImpl
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/PropertyChangeImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/PropertyChangeImpl.java
new file mode 100644
index 0000000000..d8e7d9b720
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/PropertyChangeImpl.java
@@ -0,0 +1,301 @@
+/**
+ */
+package org.eclipse.emf.cdo.evolution.impl;
+
+import org.eclipse.emf.cdo.evolution.Change;
+import org.eclipse.emf.cdo.evolution.ChangeKind;
+import org.eclipse.emf.cdo.evolution.EvolutionPackage;
+import org.eclipse.emf.cdo.evolution.ModelSet;
+import org.eclipse.emf.cdo.evolution.PropertyChange;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ *
+ * An implementation of the model object 'Property Change'.
+ *
+ *
+ * The following features are implemented:
+ *
+ *
+ * - {@link org.eclipse.emf.cdo.evolution.impl.PropertyChangeImpl#getFeature Feature}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.PropertyChangeImpl#getOldValue Old Value}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.PropertyChangeImpl#getNewValue New Value}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.PropertyChangeImpl#getKind Kind}
+ *
+ *
+ * @generated
+ */
+public class PropertyChangeImpl extends ChangeImpl implements PropertyChange
+{
+ /**
+ * The default value of the '{@link #getOldValue() Old Value}' attribute.
+ *
+ *
+ * @see #getOldValue()
+ * @generated
+ * @ordered
+ */
+ protected static final Object OLD_VALUE_EDEFAULT = null;
+
+ /**
+ * The default value of the '{@link #getNewValue() New Value}' attribute.
+ *
+ *
+ * @see #getNewValue()
+ * @generated
+ * @ordered
+ */
+ protected static final Object NEW_VALUE_EDEFAULT = null;
+
+ /**
+ * The default value of the '{@link #getKind() Kind}' attribute.
+ *
+ *
+ * @see #getKind()
+ * @generated
+ * @ordered
+ */
+ protected static final ChangeKind KIND_EDEFAULT = ChangeKind.NONE;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected PropertyChangeImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return EvolutionPackage.Literals.PROPERTY_CHANGE;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EStructuralFeature getFeature()
+ {
+ return (EStructuralFeature)eDynamicGet(EvolutionPackage.PROPERTY_CHANGE__FEATURE, EvolutionPackage.Literals.PROPERTY_CHANGE__FEATURE, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EStructuralFeature basicGetFeature()
+ {
+ return (EStructuralFeature)eDynamicGet(EvolutionPackage.PROPERTY_CHANGE__FEATURE, EvolutionPackage.Literals.PROPERTY_CHANGE__FEATURE, false, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setFeature(EStructuralFeature newFeature)
+ {
+ eDynamicSet(EvolutionPackage.PROPERTY_CHANGE__FEATURE, EvolutionPackage.Literals.PROPERTY_CHANGE__FEATURE, newFeature);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public Object getOldValue()
+ {
+ return eDynamicGet(EvolutionPackage.PROPERTY_CHANGE__OLD_VALUE, EvolutionPackage.Literals.PROPERTY_CHANGE__OLD_VALUE, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setOldValue(Object newOldValue)
+ {
+ eDynamicSet(EvolutionPackage.PROPERTY_CHANGE__OLD_VALUE, EvolutionPackage.Literals.PROPERTY_CHANGE__OLD_VALUE, newOldValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public Object getNewValue()
+ {
+ return eDynamicGet(EvolutionPackage.PROPERTY_CHANGE__NEW_VALUE, EvolutionPackage.Literals.PROPERTY_CHANGE__NEW_VALUE, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setNewValue(Object newNewValue)
+ {
+ eDynamicSet(EvolutionPackage.PROPERTY_CHANGE__NEW_VALUE, EvolutionPackage.Literals.PROPERTY_CHANGE__NEW_VALUE, newNewValue);
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public ChangeKind getKind()
+ {
+ Object oldValue = getOldValue();
+ Object newValue = getNewValue();
+
+ if (oldValue == null)
+ {
+ if (newValue == null)
+ {
+ return ChangeKind.NONE;
+ }
+
+ return ChangeKind.ADDED;
+ }
+ else
+ {
+ if (newValue == null)
+ {
+ return ChangeKind.REMOVED;
+ }
+
+ return ChangeKind.CHANGED;
+ }
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.PROPERTY_CHANGE__FEATURE:
+ if (resolve)
+ {
+ return getFeature();
+ }
+ return basicGetFeature();
+ case EvolutionPackage.PROPERTY_CHANGE__OLD_VALUE:
+ return getOldValue();
+ case EvolutionPackage.PROPERTY_CHANGE__NEW_VALUE:
+ return getNewValue();
+ case EvolutionPackage.PROPERTY_CHANGE__KIND:
+ return getKind();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.PROPERTY_CHANGE__FEATURE:
+ setFeature((EStructuralFeature)newValue);
+ return;
+ case EvolutionPackage.PROPERTY_CHANGE__OLD_VALUE:
+ setOldValue(newValue);
+ return;
+ case EvolutionPackage.PROPERTY_CHANGE__NEW_VALUE:
+ setNewValue(newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.PROPERTY_CHANGE__FEATURE:
+ setFeature((EStructuralFeature)null);
+ return;
+ case EvolutionPackage.PROPERTY_CHANGE__OLD_VALUE:
+ setOldValue(OLD_VALUE_EDEFAULT);
+ return;
+ case EvolutionPackage.PROPERTY_CHANGE__NEW_VALUE:
+ setNewValue(NEW_VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.PROPERTY_CHANGE__FEATURE:
+ return basicGetFeature() != null;
+ case EvolutionPackage.PROPERTY_CHANGE__OLD_VALUE:
+ return OLD_VALUE_EDEFAULT == null ? getOldValue() != null : !OLD_VALUE_EDEFAULT.equals(getOldValue());
+ case EvolutionPackage.PROPERTY_CHANGE__NEW_VALUE:
+ return NEW_VALUE_EDEFAULT == null ? getNewValue() != null : !NEW_VALUE_EDEFAULT.equals(getNewValue());
+ case EvolutionPackage.PROPERTY_CHANGE__KIND:
+ return getKind() != KIND_EDEFAULT;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ @Override
+ public ModelSet getOldModelSet()
+ {
+ Change parent = getParent();
+ if (parent != null)
+ {
+ return parent.getOldModelSet();
+ }
+
+ return null;
+ }
+
+ @Override
+ public ModelSet getNewModelSet()
+ {
+ Change parent = getParent();
+ if (parent != null)
+ {
+ return parent.getNewModelSet();
+ }
+
+ return null;
+ }
+
+} // PropertyChangeImpl
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ReleaseImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ReleaseImpl.java
new file mode 100644
index 0000000000..f219630386
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ReleaseImpl.java
@@ -0,0 +1,463 @@
+/**
+ */
+package org.eclipse.emf.cdo.evolution.impl;
+
+import org.eclipse.emf.cdo.evolution.Evolution;
+import org.eclipse.emf.cdo.evolution.EvolutionPackage;
+import org.eclipse.emf.cdo.evolution.Release;
+import org.eclipse.emf.cdo.evolution.util.ElementHandler;
+import org.eclipse.emf.cdo.evolution.util.ElementRunnable;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
+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.InternalEObject;
+import org.eclipse.emf.ecore.util.EcoreEList;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * An implementation of the model object 'Release'.
+ *
+ *
+ * The following features are implemented:
+ *
+ *
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getEvolution Evolution}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getVersion Version}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getDate Date}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getNextRelease Next Release}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getPreviousRelease Previous Release}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getRootPackages Root Packages}
+ * - {@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getAllPackages All Packages}
+ *
+ *
+ * @generated
+ */
+public class ReleaseImpl extends ModelSetImpl implements Release
+{
+ /**
+ * The default value of the '{@link #getVersion() Version}' attribute.
+ *
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected static final int VERSION_EDEFAULT = 0;
+
+ /**
+ * The default value of the '{@link #getDate() Date}' attribute.
+ *
+ *
+ * @see #getDate()
+ * @generated
+ * @ordered
+ */
+ protected static final Date DATE_EDEFAULT = null;
+
+ private Map idCache;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected ReleaseImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return EvolutionPackage.Literals.RELEASE;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public Date getDate()
+ {
+ return (Date)eDynamicGet(EvolutionPackage.RELEASE__DATE, EvolutionPackage.Literals.RELEASE__DATE, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setDate(Date newDate)
+ {
+ eDynamicSet(EvolutionPackage.RELEASE__DATE, EvolutionPackage.Literals.RELEASE__DATE, newDate);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public Release getNextRelease()
+ {
+ Release nextRelease = basicGetNextRelease();
+ return nextRelease != null && ((EObject)nextRelease).eIsProxy() ? (Release)eResolveProxy((InternalEObject)nextRelease) : nextRelease;
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public Release basicGetNextRelease()
+ {
+ int nextVersion = getVersion() + 1;
+ return getEvolution().getRelease(nextVersion);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Release getPreviousRelease()
+ {
+ Release previousRelease = basicGetPreviousRelease();
+ return previousRelease != null && ((EObject)previousRelease).eIsProxy() ? (Release)eResolveProxy((InternalEObject)previousRelease) : previousRelease;
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ public Release basicGetPreviousRelease()
+ {
+ int previousVersion = getVersion() - 1;
+ if (previousVersion < 1)
+ {
+ return null;
+ }
+
+ return getEvolution().getRelease(previousVersion);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public int getVersion()
+ {
+ return (Integer)eDynamicGet(EvolutionPackage.RELEASE__VERSION, EvolutionPackage.Literals.RELEASE__VERSION, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setVersion(int newVersion)
+ {
+ eDynamicSet(EvolutionPackage.RELEASE__VERSION, EvolutionPackage.Literals.RELEASE__VERSION, newVersion);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ public EList getRootPackages()
+ {
+ return (EList)eDynamicGet(EvolutionPackage.RELEASE__ROOT_PACKAGES, EvolutionPackage.Literals.RELEASE__ROOT_PACKAGES, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Evolution getEvolution()
+ {
+ return (Evolution)eDynamicGet(EvolutionPackage.RELEASE__EVOLUTION, EvolutionPackage.Literals.RELEASE__EVOLUTION, true, true);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public NotificationChain basicSetEvolution(Evolution newEvolution, NotificationChain msgs)
+ {
+ msgs = eBasicSetContainer((InternalEObject)newEvolution, EvolutionPackage.RELEASE__EVOLUTION, msgs);
+ return msgs;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setEvolution(Evolution newEvolution)
+ {
+ eDynamicSet(EvolutionPackage.RELEASE__EVOLUTION, EvolutionPackage.Literals.RELEASE__EVOLUTION, newEvolution);
+ }
+
+ /**
+ *
+ *
+ * @generated NOT
+ */
+ @Override
+ public EList getAllPackages()
+ {
+ EcoreEList list = new EcoreEList(EPackage.class, this)
+ {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public int getFeatureID()
+ {
+ return EvolutionPackage.MODEL__ALL_PACKAGES;
+ }
+ };
+
+ for (EPackage rootPackage : getRootPackages())
+ {
+ ModelImpl.collectAllPackages(rootPackage, list);
+ }
+
+ return list;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.RELEASE__EVOLUTION:
+ if (eInternalContainer() != null)
+ {
+ msgs = eBasicRemoveFromContainer(msgs);
+ }
+ return basicSetEvolution((Evolution)otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.RELEASE__EVOLUTION:
+ return basicSetEvolution(null, msgs);
+ case EvolutionPackage.RELEASE__ROOT_PACKAGES:
+ return ((InternalEList>)getRootPackages()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs)
+ {
+ switch (eContainerFeatureID())
+ {
+ case EvolutionPackage.RELEASE__EVOLUTION:
+ return eInternalContainer().eInverseRemove(this, EvolutionPackage.EVOLUTION__RELEASES, Evolution.class, msgs);
+ }
+ return super.eBasicRemoveFromContainerFeature(msgs);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.RELEASE__EVOLUTION:
+ return getEvolution();
+ case EvolutionPackage.RELEASE__VERSION:
+ return getVersion();
+ case EvolutionPackage.RELEASE__DATE:
+ return getDate();
+ case EvolutionPackage.RELEASE__NEXT_RELEASE:
+ if (resolve)
+ {
+ return getNextRelease();
+ }
+ return basicGetNextRelease();
+ case EvolutionPackage.RELEASE__PREVIOUS_RELEASE:
+ if (resolve)
+ {
+ return getPreviousRelease();
+ }
+ return basicGetPreviousRelease();
+ case EvolutionPackage.RELEASE__ROOT_PACKAGES:
+ return getRootPackages();
+ case EvolutionPackage.RELEASE__ALL_PACKAGES:
+ return getAllPackages();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.RELEASE__EVOLUTION:
+ setEvolution((Evolution)newValue);
+ return;
+ case EvolutionPackage.RELEASE__VERSION:
+ setVersion((Integer)newValue);
+ return;
+ case EvolutionPackage.RELEASE__DATE:
+ setDate((Date)newValue);
+ return;
+ case EvolutionPackage.RELEASE__ROOT_PACKAGES:
+ getRootPackages().clear();
+ getRootPackages().addAll((Collection extends EPackage>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.RELEASE__EVOLUTION:
+ setEvolution((Evolution)null);
+ return;
+ case EvolutionPackage.RELEASE__VERSION:
+ setVersion(VERSION_EDEFAULT);
+ return;
+ case EvolutionPackage.RELEASE__DATE:
+ setDate(DATE_EDEFAULT);
+ return;
+ case EvolutionPackage.RELEASE__ROOT_PACKAGES:
+ getRootPackages().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case EvolutionPackage.RELEASE__EVOLUTION:
+ return getEvolution() != null;
+ case EvolutionPackage.RELEASE__VERSION:
+ return getVersion() != VERSION_EDEFAULT;
+ case EvolutionPackage.RELEASE__DATE:
+ return DATE_EDEFAULT == null ? getDate() != null : !DATE_EDEFAULT.equals(getDate());
+ case EvolutionPackage.RELEASE__NEXT_RELEASE:
+ return basicGetNextRelease() != null;
+ case EvolutionPackage.RELEASE__PREVIOUS_RELEASE:
+ return basicGetPreviousRelease() != null;
+ case EvolutionPackage.RELEASE__ROOT_PACKAGES:
+ return !getRootPackages().isEmpty();
+ case EvolutionPackage.RELEASE__ALL_PACKAGES:
+ return !getAllPackages().isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ public int compareTo(Release o)
+ {
+ return o.getVersion() - getVersion();
+ }
+
+ @Override
+ public void invalidateChange()
+ {
+ // Do nothing.
+ }
+
+ @Override
+ public boolean containsElement(EModelElement modelElement)
+ {
+ return EcoreUtil.isAncestor(this, modelElement);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public T getElement(String id)
+ {
+ if (idCache == null)
+ {
+ idCache = new HashMap();
+
+ ElementHandler.execute(getRootPackages(), new ElementRunnable()
+ {
+ public void run(EModelElement modelElement)
+ {
+ String id = getElementID(modelElement);
+ idCache.put(id, modelElement);
+ }
+ });
+ }
+
+ return (T)idCache.get(id);
+ }
+
+} // ReleaseImpl
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/DiagnosticID.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/DiagnosticID.java
new file mode 100644
index 0000000000..eaea7ad7cb
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/DiagnosticID.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2004-2018 Eike Stepper (Loehne, 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
+ */
+package org.eclipse.emf.cdo.evolution.util;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.EModelElement;
+
+/**
+ * @author Eike Stepper
+ */
+public final class DiagnosticID
+{
+ private final String value;
+
+ public DiagnosticID(String value)
+ {
+ this.value = value;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return 31 + (value == null ? 0 : value.hashCode());
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ {
+ return true;
+ }
+
+ if (obj == null)
+ {
+ return false;
+ }
+
+ if (getClass() != obj.getClass())
+ {
+ return false;
+ }
+
+ DiagnosticID other = (DiagnosticID)obj;
+ if (value == null)
+ {
+ if (other.value != null)
+ {
+ return false;
+ }
+ }
+ else if (!value.equals(other.value))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "DiagnosticID[" + value + "]";
+ }
+
+ public static DiagnosticID get(Diagnostic diagnostic)
+ {
+ for (Object data : diagnostic.getData())
+ {
+ if (data instanceof DiagnosticID)
+ {
+ return (DiagnosticID)data;
+ }
+ }
+
+ StringBuilder builder = new StringBuilder();
+ builder.append(diagnostic.getSource());
+ builder.append("|");
+ builder.append(diagnostic.getCode());
+
+ for (Object data : diagnostic.getData())
+ {
+ appendData(builder, data);
+ }
+
+ return new DiagnosticID(builder.toString());
+ }
+
+ private static void appendData(final StringBuilder builder, Object data)
+ {
+ if (data instanceof Provider)
+ {
+ Provider provider = (Provider)data;
+ provider.extractDiagnosticData(new Provider.Context()
+ {
+ public void add(String data)
+ {
+ builder.append("|");
+ builder.append(data);
+ }
+ });
+
+ return;
+ }
+
+ if (data instanceof EModelElement)
+ {
+ EModelElement modelElement = (EModelElement)data;
+ String label = ElementHandler.getLabel(modelElement);
+ if (label != null)
+ {
+ builder.append("|");
+ builder.append(label);
+ return;
+ }
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public interface Provider
+ {
+ public void extractDiagnosticData(Context context);
+
+ /**
+ * @author Eike Stepper
+ */
+ public interface Context
+ {
+ public void add(String data);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/DiagnosticType.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/DiagnosticType.java
new file mode 100644
index 0000000000..34e0bd4dba
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/DiagnosticType.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2004-2018 Eike Stepper (Loehne, 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
+ */
+package org.eclipse.emf.cdo.evolution.util;
+
+import org.eclipse.emf.common.util.Diagnostic;
+
+/**
+ * @author Eike Stepper
+ */
+public final class DiagnosticType
+{
+ private final String source;
+
+ private final int code;
+
+ public DiagnosticType(String source, int code)
+ {
+ this.source = source;
+ this.code = code;
+ }
+
+ public String getSource()
+ {
+ return source;
+ }
+
+ public int getCode()
+ {
+ return code;
+ }
+
+ public boolean appliesTo(Diagnostic diagnostic)
+ {
+ return code == diagnostic.getCode() && source.equals(diagnostic.getSource());
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + code;
+ result = prime * result + (source == null ? 0 : source.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ {
+ return true;
+ }
+
+ if (obj == null)
+ {
+ return false;
+ }
+
+ if (getClass() != obj.getClass())
+ {
+ return false;
+ }
+
+ DiagnosticType other = (DiagnosticType)obj;
+ if (code != other.code)
+ {
+ return false;
+ }
+
+ if (source == null)
+ {
+ if (other.source != null)
+ {
+ return false;
+ }
+ }
+ else if (!source.equals(other.source))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("DiagnosticType[");
+ builder.append(source);
+ builder.append(":");
+ builder.append(code);
+ builder.append("]");
+ return builder.toString();
+ }
+
+ public static DiagnosticType from(Diagnostic diagnostic)
+ {
+ return new DiagnosticType(diagnostic.getSource(), diagnostic.getCode());
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ElementHandler.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ElementHandler.java
new file mode 100644
index 0000000000..f5176925e4
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ElementHandler.java
@@ -0,0 +1,465 @@
+/*
+ * Copyright (c) 2004-2018 Eike Stepper (Loehne, 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
+ */
+package org.eclipse.emf.cdo.evolution.util;
+
+import org.eclipse.emf.cdo.evolution.ModelSet;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
+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 java.util.List;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class ElementHandler
+{
+ private static ElementHandler PACKAGE = new PackageHandler();
+
+ private static ElementHandler CLASS = new ClassHandler();
+
+ private static ElementHandler ATTRIBUTE = new AttributeHandler();
+
+ private static ElementHandler REFERENCE = new ReferenceHandler();
+
+ private static ElementHandler DATA_TYPE = new DataTypeHandler();
+
+ private static ElementHandler ENUM = new EnumHandler();
+
+ private static ElementHandler ENUM_LITERAL = new EnumLiteralHandler();
+
+ private static final EReference[] NO_CHILD_FEATURES = {};
+
+ private ElementHandler()
+ {
+ }
+
+ public abstract EClass getEClass();
+
+ public EReference[] getChildFeatures()
+ {
+ return NO_CHILD_FEATURES;
+ }
+
+ public boolean hasChildFeatures()
+ {
+ return getChildFeatures().length != 0;
+ }
+
+ protected abstract String computeLabel(EModelElement element);
+
+ public static ElementHandler getHandler(EClass eClass)
+ {
+ if (eClass.getEPackage() == EcorePackage.eINSTANCE)
+ {
+ switch (eClass.getClassifierID())
+ {
+ case EcorePackage.EPACKAGE:
+ return PACKAGE;
+
+ case EcorePackage.ECLASS:
+ return CLASS;
+
+ case EcorePackage.EATTRIBUTE:
+ return ATTRIBUTE;
+
+ case EcorePackage.EREFERENCE:
+ return REFERENCE;
+
+ case EcorePackage.EDATA_TYPE:
+ return DATA_TYPE;
+
+ case EcorePackage.EENUM:
+ return ENUM;
+
+ case EcorePackage.EENUM_LITERAL:
+ return ENUM_LITERAL;
+ }
+ }
+
+ return null;
+ }
+
+ public static String getLabel(EModelElement element)
+ {
+ ElementHandler handler = getHandler(element.eClass());
+ if (handler != null)
+ {
+ return handler.computeLabel(element);
+ }
+
+ return String.valueOf(element);
+ }
+
+ public static ModelSet getModelSet(EModelElement element)
+ {
+ EObject eContainer;
+ while ((eContainer = element.eContainer()) != null)
+ {
+ if (eContainer instanceof ModelSet)
+ {
+ return (ModelSet)eContainer;
+ }
+ }
+
+ return null;
+ }
+
+ public static void execute(EModelElement element, ElementRunnable runnable)
+ {
+ runnable.run(element);
+
+ EClass eClass = element.eClass();
+ ElementHandler handler = getHandler(eClass);
+ if (handler != null)
+ {
+ EReference[] childFeatures = handler.getChildFeatures();
+ for (int i = 0; i < childFeatures.length; i++)
+ {
+ EReference childFeature = childFeatures[i];
+
+ List> children = (List>)element.eGet(childFeature);
+ for (Object child : children)
+ {
+ if (child instanceof EModelElement)
+ {
+ execute((EModelElement)child, runnable);
+ }
+ }
+ }
+ }
+ }
+
+ public static void execute(List extends EModelElement> elements, ElementRunnable runnable)
+ {
+ for (EModelElement element : elements)
+ {
+ execute(element, runnable);
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ // dumpRelevantContainments();
+ dumpManyValuedNonContainments();
+ }
+
+ private static void dumpRelevantContainments()
+ {
+ for (EClassifier eClassifier : EcorePackage.eINSTANCE.getEClassifiers())
+ {
+ if (eClassifier instanceof EClass)
+ {
+ EClass eClass = (EClass)eClassifier;
+
+ if (eClass == EcorePackage.Literals.EOPERATION)
+ {
+ continue;
+ }
+
+ if (eClass == EcorePackage.Literals.EGENERIC_TYPE)
+ {
+ continue;
+ }
+
+ if (eClass == EcorePackage.Literals.ETYPE_PARAMETER)
+ {
+ continue;
+ }
+
+ boolean first = true;
+ for (EStructuralFeature eStructuralFeature : eClass.getEStructuralFeatures())
+ {
+ if (eStructuralFeature instanceof EReference)
+ {
+ EReference eReference = (EReference)eStructuralFeature;
+ if (eReference.isContainment())
+ {
+ if (eReference == EcorePackage.Literals.ECLASS__EOPERATIONS)
+ {
+ continue;
+ }
+
+ if (eReference == EcorePackage.Literals.ECLASS__EGENERIC_SUPER_TYPES)
+ {
+ continue;
+ }
+
+ if (eReference == EcorePackage.Literals.ECLASSIFIER__ETYPE_PARAMETERS)
+ {
+ continue;
+ }
+
+ if (eReference == EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE)
+ {
+ continue;
+ }
+
+ if (first)
+ {
+ System.out.println(eClass.getName());
+ first = false;
+ }
+
+ System.out.println(" " + eReference.getName() + (eReference.isDerived() ? " DERIVED" : ""));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private static void dumpManyValuedNonContainments()
+ {
+ for (EClassifier eClassifier : EcorePackage.eINSTANCE.getEClassifiers())
+ {
+ if (eClassifier instanceof EClass)
+ {
+ EClass eClass = (EClass)eClassifier;
+
+ boolean first = true;
+ for (EStructuralFeature eStructuralFeature : eClass.getEStructuralFeatures())
+ {
+ if (!eStructuralFeature.isMany())
+ {
+ continue;
+ }
+
+ if (eStructuralFeature instanceof EReference)
+ {
+ EReference eReference = (EReference)eStructuralFeature;
+ if (eReference.isContainment())
+ {
+ continue;
+ }
+ }
+
+ if (first)
+ {
+ System.out.println(eClass.getName());
+ first = false;
+ }
+
+ System.out.println(" " + eStructuralFeature.getName() + (eStructuralFeature.isDerived() ? " DERIVED" : ""));
+ }
+ }
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class PackageHandler extends ElementHandler
+ {
+ private static final EReference[] CHILDREN = { EcorePackage.Literals.EPACKAGE__ECLASSIFIERS, EcorePackage.Literals.EPACKAGE__ESUBPACKAGES };
+
+ @Override
+ public EClass getEClass()
+ {
+ return EcorePackage.Literals.EPACKAGE;
+ }
+
+ @Override
+ public EReference[] getChildFeatures()
+ {
+ return CHILDREN;
+ }
+
+ @Override
+ protected String computeLabel(EModelElement element)
+ {
+ EPackage ePackage = (EPackage)element;
+ EPackage eSuperPackage = ePackage.getESuperPackage();
+ if (eSuperPackage != null)
+ {
+ return computeLabel(eSuperPackage) + "." + ePackage.getName();
+ }
+
+ return ePackage.getName();
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class ClassHandler extends ElementHandler
+ {
+ private static final EReference[] CHILDREN = { EcorePackage.Literals.ECLASS__ESTRUCTURAL_FEATURES };
+
+ @Override
+ public EClass getEClass()
+ {
+ return EcorePackage.Literals.ECLASS;
+ }
+
+ @Override
+ public EReference[] getChildFeatures()
+ {
+ return CHILDREN;
+ }
+
+ @Override
+ protected String computeLabel(EModelElement element)
+ {
+ EClass eClass = (EClass)element;
+ EPackage ePackage = eClass.getEPackage();
+ if (ePackage != null)
+ {
+ return getLabel(ePackage) + "." + eClass.getName();
+ }
+
+ return eClass.getName();
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static class AttributeHandler extends ElementHandler
+ {
+ @Override
+ public EClass getEClass()
+ {
+ return EcorePackage.Literals.EATTRIBUTE;
+ }
+
+ @Override
+ protected String computeLabel(EModelElement element)
+ {
+ EAttribute eAttribute = (EAttribute)element;
+ EClass eClass = eAttribute.getEContainingClass();
+ if (eClass != null)
+ {
+ return getLabel(eClass) + "." + eAttribute.getName();
+ }
+
+ return eAttribute.getName();
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static class ReferenceHandler extends ElementHandler
+ {
+ @Override
+ public EClass getEClass()
+ {
+ return EcorePackage.Literals.EREFERENCE;
+ }
+
+ @Override
+ protected String computeLabel(EModelElement element)
+ {
+ EReference eReference = (EReference)element;
+ EClass eClass = eReference.getEContainingClass();
+ if (eClass != null)
+ {
+ return getLabel(eClass) + "." + eReference.getName();
+ }
+
+ return eReference.getName();
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class DataTypeHandler extends ElementHandler
+ {
+ @Override
+ public EClass getEClass()
+ {
+ return EcorePackage.Literals.EDATA_TYPE;
+ }
+
+ @Override
+ protected String computeLabel(EModelElement element)
+ {
+ EDataType eDataType = (EDataType)element;
+ EPackage ePackage = eDataType.getEPackage();
+ if (ePackage != null)
+ {
+ return getLabel(ePackage) + "." + eDataType.getName();
+ }
+
+ return eDataType.getName();
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class EnumHandler extends ElementHandler
+ {
+ private static final EReference[] CHILDREN = { EcorePackage.Literals.EENUM__ELITERALS };
+
+ @Override
+ public EClass getEClass()
+ {
+ return EcorePackage.Literals.EENUM;
+ }
+
+ @Override
+ public EReference[] getChildFeatures()
+ {
+ return CHILDREN;
+ }
+
+ @Override
+ protected String computeLabel(EModelElement element)
+ {
+ EEnum eEnum = (EEnum)element;
+ EPackage ePackage = eEnum.getEPackage();
+ if (ePackage != null)
+ {
+ return getLabel(ePackage) + "." + eEnum.getName();
+ }
+
+ return eEnum.getName();
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class EnumLiteralHandler extends ElementHandler
+ {
+ @Override
+ public EClass getEClass()
+ {
+ return EcorePackage.Literals.EENUM_LITERAL;
+ }
+
+ @Override
+ protected String computeLabel(EModelElement element)
+ {
+ EEnumLiteral eLiteral = (EEnumLiteral)element;
+ EEnum eEnum = eLiteral.getEEnum();
+ if (eEnum != null)
+ {
+ return getLabel(eEnum) + "." + eLiteral.getName();
+ }
+
+ return eLiteral.getName();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ElementRunnable.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ElementRunnable.java
new file mode 100644
index 0000000000..f5907cb02d
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ElementRunnable.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2004-2018 Eike Stepper (Loehne, 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
+ */
+package org.eclipse.emf.cdo.evolution.util;
+
+import org.eclipse.emf.ecore.EModelElement;
+
+/**
+ * @author Eike Stepper
+ */
+public interface ElementRunnable
+{
+ public void run(EModelElement modelElement);
+}
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionAdapterFactory.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionAdapterFactory.java
new file mode 100644
index 0000000000..c9a6d166f7
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionAdapterFactory.java
@@ -0,0 +1,328 @@
+/**
+ */
+package org.eclipse.emf.cdo.evolution.util;
+
+import org.eclipse.emf.cdo.evolution.Change;
+import org.eclipse.emf.cdo.evolution.ElementChange;
+import org.eclipse.emf.cdo.evolution.Evolution;
+import org.eclipse.emf.cdo.evolution.EvolutionPackage;
+import org.eclipse.emf.cdo.evolution.FeaturePathMigration;
+import org.eclipse.emf.cdo.evolution.Migration;
+import org.eclipse.emf.cdo.evolution.Model;
+import org.eclipse.emf.cdo.evolution.ModelSet;
+import org.eclipse.emf.cdo.evolution.ModelSetChange;
+import org.eclipse.emf.cdo.evolution.PropertyChange;
+import org.eclipse.emf.cdo.evolution.Release;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ *
+ * The Adapter Factory for the model.
+ * It provides an adapter createXXX
method for each class of the model.
+ *
+ * @see org.eclipse.emf.cdo.evolution.EvolutionPackage
+ * @generated
+ */
+public class EvolutionAdapterFactory extends AdapterFactoryImpl
+{
+ /**
+ * The cached model package.
+ *
+ *
+ * @generated
+ */
+ protected static EvolutionPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ *
+ *
+ * @generated
+ */
+ public EvolutionAdapterFactory()
+ {
+ if (modelPackage == null)
+ {
+ modelPackage = EvolutionPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ *
+ * This implementation returns true
if the object is either the model's package or is an instance object of the model.
+ *
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object)
+ {
+ if (object == modelPackage)
+ {
+ return true;
+ }
+ if (object instanceof EObject)
+ {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the createXXX
methods.
+ *
+ *
+ * @generated
+ */
+ protected EvolutionSwitch modelSwitch = new EvolutionSwitch()
+ {
+ @Override
+ public Adapter caseModelSet(ModelSet object)
+ {
+ return createModelSetAdapter();
+ }
+
+ @Override
+ public Adapter caseModel(Model object)
+ {
+ return createModelAdapter();
+ }
+
+ @Override
+ public Adapter caseEvolution(Evolution object)
+ {
+ return createEvolutionAdapter();
+ }
+
+ @Override
+ public Adapter caseRelease(Release object)
+ {
+ return createReleaseAdapter();
+ }
+
+ @Override
+ public Adapter caseChange(Change object)
+ {
+ return createChangeAdapter();
+ }
+
+ @Override
+ public Adapter caseModelSetChange(ModelSetChange object)
+ {
+ return createModelSetChangeAdapter();
+ }
+
+ @Override
+ public Adapter caseElementChange(ElementChange object)
+ {
+ return createElementChangeAdapter();
+ }
+
+ @Override
+ public Adapter casePropertyChange(PropertyChange object)
+ {
+ return createPropertyChangeAdapter();
+ }
+
+ @Override
+ public Adapter caseMigration(Migration object)
+ {
+ return createMigrationAdapter();
+ }
+
+ @Override
+ public Adapter caseFeaturePathMigration(FeaturePathMigration object)
+ {
+ return createFeaturePathMigrationAdapter();
+ }
+
+ @Override
+ public Adapter defaultCase(EObject object)
+ {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the target
.
+ *
+ *
+ * @param target the object to adapt.
+ * @return the adapter for the target
.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target)
+ {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.ModelSet Model Set}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.evolution.ModelSet
+ * @generated
+ */
+ public Adapter createModelSetAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.Model Model}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.evolution.Model
+ * @generated
+ */
+ public Adapter createModelAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.Evolution Evolution}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.evolution.Evolution
+ * @generated
+ */
+ public Adapter createEvolutionAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.Release Release}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.evolution.Release
+ * @generated
+ */
+ public Adapter createReleaseAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.Change Change}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.evolution.Change
+ * @generated
+ */
+ public Adapter createChangeAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.ModelSetChange Model Set Change}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.evolution.ModelSetChange
+ * @generated
+ */
+ public Adapter createModelSetChangeAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.ElementChange Element Change}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.evolution.ElementChange
+ * @generated
+ */
+ public Adapter createElementChangeAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.PropertyChange Property Change}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.evolution.PropertyChange
+ * @generated
+ */
+ public Adapter createPropertyChangeAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.Migration Migration}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.evolution.Migration
+ * @generated
+ */
+ public Adapter createMigrationAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.FeaturePathMigration Feature Path Migration}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.evolution.FeaturePathMigration
+ * @generated
+ */
+ public Adapter createFeaturePathMigrationAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ *
+ * This default implementation returns null.
+ *
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter()
+ {
+ return null;
+ }
+
+} // EvolutionAdapterFactory
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionSwitch.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionSwitch.java
new file mode 100644
index 0000000000..e630b1f7ef
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionSwitch.java
@@ -0,0 +1,390 @@
+/**
+ */
+package org.eclipse.emf.cdo.evolution.util;
+
+import org.eclipse.emf.cdo.evolution.Change;
+import org.eclipse.emf.cdo.evolution.ElementChange;
+import org.eclipse.emf.cdo.evolution.Evolution;
+import org.eclipse.emf.cdo.evolution.EvolutionPackage;
+import org.eclipse.emf.cdo.evolution.FeaturePathMigration;
+import org.eclipse.emf.cdo.evolution.Migration;
+import org.eclipse.emf.cdo.evolution.Model;
+import org.eclipse.emf.cdo.evolution.ModelSet;
+import org.eclipse.emf.cdo.evolution.ModelSetChange;
+import org.eclipse.emf.cdo.evolution.PropertyChange;
+import org.eclipse.emf.cdo.evolution.Release;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.util.Switch;
+
+/**
+ *
+ * The Switch for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the caseXXX
method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ *
+ * @see org.eclipse.emf.cdo.evolution.EvolutionPackage
+ * @generated
+ */
+public class EvolutionSwitch extends Switch
+{
+ /**
+ * The cached model package
+ *
+ *
+ * @generated
+ */
+ protected static EvolutionPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ *
+ *
+ * @generated
+ */
+ public EvolutionSwitch()
+ {
+ if (modelPackage == null)
+ {
+ modelPackage = EvolutionPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ *
+ *
+ * @param ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage)
+ {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls caseXXX
for each class of the model until one returns a non null result; it yields that result.
+ *
+ *
+ * @return the first non-null result returned by a caseXXX
call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject)
+ {
+ switch (classifierID)
+ {
+ case EvolutionPackage.MODEL_SET:
+ {
+ ModelSet modelSet = (ModelSet)theEObject;
+ T result = caseModelSet(modelSet);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
+ case EvolutionPackage.MODEL:
+ {
+ Model model = (Model)theEObject;
+ T result = caseModel(model);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
+ case EvolutionPackage.EVOLUTION:
+ {
+ Evolution evolution = (Evolution)theEObject;
+ T result = caseEvolution(evolution);
+ if (result == null)
+ {
+ result = caseModelSet(evolution);
+ }
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
+ case EvolutionPackage.RELEASE:
+ {
+ Release release = (Release)theEObject;
+ T result = caseRelease(release);
+ if (result == null)
+ {
+ result = caseModelSet(release);
+ }
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
+ case EvolutionPackage.CHANGE:
+ {
+ Change change = (Change)theEObject;
+ T result = caseChange(change);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
+ case EvolutionPackage.MODEL_SET_CHANGE:
+ {
+ ModelSetChange modelSetChange = (ModelSetChange)theEObject;
+ T result = caseModelSetChange(modelSetChange);
+ if (result == null)
+ {
+ result = caseChange(modelSetChange);
+ }
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
+ case EvolutionPackage.ELEMENT_CHANGE:
+ {
+ ElementChange elementChange = (ElementChange)theEObject;
+ T result = caseElementChange(elementChange);
+ if (result == null)
+ {
+ result = caseChange(elementChange);
+ }
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
+ case EvolutionPackage.PROPERTY_CHANGE:
+ {
+ PropertyChange propertyChange = (PropertyChange)theEObject;
+ T result = casePropertyChange(propertyChange);
+ if (result == null)
+ {
+ result = caseChange(propertyChange);
+ }
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
+ case EvolutionPackage.MIGRATION:
+ {
+ Migration migration = (Migration)theEObject;
+ T result = caseMigration(migration);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
+ case EvolutionPackage.FEATURE_PATH_MIGRATION:
+ {
+ FeaturePathMigration featurePathMigration = (FeaturePathMigration)theEObject;
+ T result = caseFeaturePathMigration(featurePathMigration);
+ if (result == null)
+ {
+ result = caseMigration(featurePathMigration);
+ }
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
+ default:
+ return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Model Set'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Model Set'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseModelSet(ModelSet object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Model'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Model'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseModel(Model object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Evolution'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Evolution'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseEvolution(Evolution object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Release'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Release'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseRelease(Release object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Change'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Change'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseChange(Change object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Model Set Change'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Model Set Change'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseModelSetChange(ModelSetChange object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Element Change'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Element Change'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseElementChange(ElementChange object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Property Change'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Property Change'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePropertyChange(PropertyChange object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Migration'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Migration'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseMigration(Migration object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Feature Path Migration'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Feature Path Migration'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseFeaturePathMigration(FeaturePathMigration object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'EObject'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'EObject'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object)
+ {
+ return null;
+ }
+
+} // EvolutionSwitch
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
new file mode 100644
index 0000000000..d16997899a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionValidator.java
@@ -0,0 +1,1032 @@
+/**
+ */
+package org.eclipse.emf.cdo.evolution.util;
+
+import org.eclipse.emf.cdo.evolution.Change;
+import org.eclipse.emf.cdo.evolution.ChangeKind;
+import org.eclipse.emf.cdo.evolution.ElementChange;
+import org.eclipse.emf.cdo.evolution.Evolution;
+import org.eclipse.emf.cdo.evolution.EvolutionPackage;
+import org.eclipse.emf.cdo.evolution.FeaturePathMigration;
+import org.eclipse.emf.cdo.evolution.Migration;
+import org.eclipse.emf.cdo.evolution.Model;
+import org.eclipse.emf.cdo.evolution.ModelSet;
+import org.eclipse.emf.cdo.evolution.ModelSetChange;
+import org.eclipse.emf.cdo.evolution.PropertyChange;
+import org.eclipse.emf.cdo.evolution.Release;
+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.Diagnostic;
+import org.eclipse.emf.common.util.DiagnosticChain;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.common.util.URI;
+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.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.util.EObjectValidator;
+import org.eclipse.emf.ecore.util.EcoreUtil.EqualityHelper;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ *
+ * The Validator for the model.
+ *
+ * @see org.eclipse.emf.cdo.evolution.EvolutionPackage
+ * @generated
+ */
+public class EvolutionValidator extends EObjectValidator
+{
+ /**
+ * The cached model package
+ *
+ *
+ * @generated
+ */
+ public static final EvolutionValidator INSTANCE = new EvolutionValidator();
+
+ /**
+ * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package.
+ *
+ *
+ * @see org.eclipse.emf.common.util.Diagnostic#getSource()
+ * @see org.eclipse.emf.common.util.Diagnostic#getCode()
+ * @generated
+ */
+ public static final String DIAGNOSTIC_SOURCE = "org.eclipse.emf.cdo.evolution";
+
+ /**
+ * A constant with a fixed name that can be used as the base value for additional hand written constants.
+ *
+ *
+ * @generated NOT
+ */
+ protected static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 0;
+
+ public static final int CODE_NO_MODEL = GENERATED_DIAGNOSTIC_CODE_COUNT + 1;
+
+ public static final int CODE_NO_URI = CODE_NO_MODEL + 1;
+
+ public static final int CODE_NO_RESOURCE_SET = CODE_NO_URI + 1;
+
+ public static final int CODE_RESOURCE_NOT_FOUND = CODE_NO_RESOURCE_SET + 1;
+
+ public static final int CODE_LOAD_PROBLEM = CODE_RESOURCE_NOT_FOUND + 1;
+
+ public static final int CODE_CONTENT_PROBLEM = CODE_LOAD_PROBLEM + 1;
+
+ public static final int CODE_PACKAGE_MISSING = CODE_CONTENT_PROBLEM + 1;
+
+ public static final int CODE_PACKAGE_NOT_UNIQUE = CODE_PACKAGE_MISSING + 1;
+
+ public static final int CODE_NSURI_NOT_UNIQUE = CODE_PACKAGE_NOT_UNIQUE + 1;
+
+ public static final int CODE_NSURI_NOT_CHANGED = CODE_NSURI_NOT_UNIQUE + 1;
+
+ public static final int CODE_ID_ANNOTATION_MISSING = CODE_NSURI_NOT_CHANGED + 1;
+
+ public static final int CODE_ID_WITHOUT_VALUE = CODE_ID_ANNOTATION_MISSING + 1;
+
+ public static final int CODE_ID_NOT_UNIQUE = CODE_ID_WITHOUT_VALUE + 1;
+
+ public static final int CODE_MIGRATION_UNUSED = CODE_ID_NOT_UNIQUE + 1;
+
+ public static final int CODE_FEATURE_PATH_UNKNOWN = CODE_MIGRATION_UNUSED + 1;
+
+ // Insert new codes above.
+
+ public static final int CODE_UNCHANGED = CODE_FEATURE_PATH_UNKNOWN + 1;
+
+ public static final int CODE_RELEASE = CODE_UNCHANGED + 1;
+
+ /**
+ * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class.
+ *
+ *
+ * @generated NOT
+ */
+ protected static final int DIAGNOSTIC_CODE_COUNT = CODE_RELEASE;
+
+ /**
+ * Creates an instance of the switch.
+ *
+ *
+ * @generated
+ */
+ public EvolutionValidator()
+ {
+ super();
+ }
+
+ @Override
+ public boolean validate_EveryReferenceIsContained(EObject eObject, DiagnosticChain diagnostics, Map