Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Wagelaar2021-03-24 07:50:03 +0000
committerDennis Wagelaar2021-03-24 22:59:37 +0000
commit3fd9d9a934825a64785ba8ce2780bff11832836c (patch)
treee0cab1f9cfc1a65e11f77f227ea010a94c963828
parent08bac9312d999d3209fb5af70441d0179d0165cb (diff)
downloadorg.eclipse.atl-3fd9d9a934825a64785ba8ce2780bff11832836c.tar.gz
org.eclipse.atl-3fd9d9a934825a64785ba8ce2780bff11832836c.tar.xz
org.eclipse.atl-3fd9d9a934825a64785ba8ce2780bff11832836c.zip
572248: [Feature] Add support for CDO
Change-Id: I7f7b15e08b02fe116e05e196aa5c26c237641850 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=572248 Signed-off-by: Dennis Wagelaar <dwagelaar@gmail.com>
-rw-r--r--plugins/org.eclipse.m2m.atl.dsls/src/org/eclipse/m2m/atl/dsls/core/EMFTCSInjector.java87
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm-feature/build.properties7
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm-feature/copyright.txt3
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm-feature/feature.properties66
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm-feature/feature.xml2
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/LoadMetamodelTask.java7
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/LoadModelTask.java12
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/NewModelTask.java4
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/RunTask.java36
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/.project17
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/build.properties22
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/copyright.txt5
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/epl-v20.html300
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/feature.properties177
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/feature.xml40
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/license.html190
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/modeling32.pngbin0 -> 2414 bytes
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/pom.xml28
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/.classpath7
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/.project28
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/META-INF/MANIFEST.MF14
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/OSGI-INF/l10n/bundle.properties3
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/about.html28
-rwxr-xr-xplugins/org.eclipse.m2m.atl.emftvm.cdo/about.ini14
-rwxr-xr-xplugins/org.eclipse.m2m.atl.emftvm.cdo/about.properties9
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/build.properties10
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/deploy/release/pom.xml39
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/deploy/snapshot/pom.xml39
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/modeling32.pngbin0 -> 2414 bytes
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/plugin.xml13
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/pom.xml115
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOInstanceOfIterable.java56
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOMetamodelImpl.java86
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOModelFactoryImpl.java44
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOModelImpl.java160
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.compiler/src/org/eclipse/m2m/atl/emftvm/compiler/AtlToEmftvmCompiler.java30
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm.launcher/src/org/eclipse/m2m/atl/emftvm/launcher/EMFTVMLaunchConfigurationDelegate.java109
-rwxr-xr-xplugins/org.eclipse.m2m.atl.emftvm/about.properties3
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/plugin.xml11
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/schema/modelfactory.exsd96
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/EmftvmFactory.java20
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/ModelFactory.java39
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/EmftvmFactoryImpl.java610
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ExecEnvImpl.java229
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/MetamodelImpl.java35
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ModelFactoryImpl.java45
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ModelImpl.java96
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/launcher/compat/EMFTVMLauncher.java81
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/EMFTVMUtil.java22
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/LazyList.java242
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/PluginExtensionUtil.java33
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/PluginExtensionUtilImpl.java62
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/WorkspaceUtil.java15
-rw-r--r--plugins/org.eclipse.m2m.atl.sdk-feature/feature.xml4
-rw-r--r--releng/org.eclipse.m2m.atl.releng.parent/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--releng/org.eclipse.m2m.atl.releng.parent/pom.xml2
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/EMFTVMTest.java65
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/ExecEnvTest.java343
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/compiler/CompilerTest.java69
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/integration/IntegrationTest.java20
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/performance/ATLtoEMFTVMPerformanceTest.java45
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/performance/EcoreCopyPerformanceTest.java36
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/pojo/PojoModelTest.java28
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/util/tests/EMFTVMUtilTest.java62
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/util/tests/ExecEnvPoolTest.java22
-rw-r--r--tests/org.eclipse.m2m.atl.tests/src/org/eclipse/m2m/atl/tests/unit/atlvm/TestNonRegressionEMFTVM.java122
67 files changed, 2983 insertions, 1293 deletions
diff --git a/plugins/org.eclipse.m2m.atl.dsls/src/org/eclipse/m2m/atl/dsls/core/EMFTCSInjector.java b/plugins/org.eclipse.m2m.atl.dsls/src/org/eclipse/m2m/atl/dsls/core/EMFTCSInjector.java
index 9dec0dbe..a532c526 100644
--- a/plugins/org.eclipse.m2m.atl.dsls/src/org/eclipse/m2m/atl/dsls/core/EMFTCSInjector.java
+++ b/plugins/org.eclipse.m2m.atl.dsls/src/org/eclipse/m2m/atl/dsls/core/EMFTCSInjector.java
@@ -1,10 +1,11 @@
/*******************************************************************************
* Copyright (c) 2009, 2012, 2014 Obeo.
+ * Copyright (c) 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
- *
+ *
* Contributors:
* Obeo - initial API and implementation
* Dennis Wagelaar
@@ -32,21 +33,18 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EcoreFactoryImpl;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
import org.eclipse.m2m.atl.common.ATLLogger;
import org.eclipse.m2m.atl.core.IModel;
import org.eclipse.m2m.atl.core.emf.EMFModel;
import org.eclipse.m2m.atl.dsls.tcs.injector.ModelAdapter;
import org.eclipse.m2m.atl.dsls.tcs.injector.ParserLauncher;
import org.eclipse.m2m.atl.emftvm.EmftvmFactory;
-import org.eclipse.m2m.atl.emftvm.EmftvmPackage;
import org.eclipse.m2m.atl.emftvm.Metamodel;
import org.eclipse.m2m.atl.emftvm.Model;
/**
* A wrapper which allow to create {@link IModel} from text with TCS.
- *
+ *
* @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
* @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
*/
@@ -87,20 +85,20 @@ public class EMFTCSInjector {
super();
}
- public Object inject(EMFModel target, InputStream source, Map params) throws IOException {
+ public Object inject(final EMFModel target, final InputStream source, final Map params) throws IOException {
return inject(target, new InputStreamReader(source), params);
}
- public Object inject(EMFModel target, Reader source, Map params) throws IOException {
- ModelAdapter targetModelAdapter = new EMFInjectorAdapter(target);
+ public Object inject(final EMFModel target, final Reader source, final Map params) throws IOException {
+ final ModelAdapter targetModelAdapter = new EMFInjectorAdapter(target);
- EMFModel problems = (EMFModel)params.get("problems");
+ final EMFModel problems = (EMFModel)params.get("problems");
if (problems != null) {
- ModelAdapter problemsModelAdapter = new EMFInjectorAdapter(problems);
+ final ModelAdapter problemsModelAdapter = new EMFInjectorAdapter(problems);
params.put("problems", problemsModelAdapter);
}
- EObject root = (EObject)new ParserLauncher().parse(targetModelAdapter, source, params);
+ final EObject root = (EObject)new ParserLauncher().parse(targetModelAdapter, source, params);
target.commitToResource();
if(problems != null)
problems.commitToResource();
@@ -117,29 +115,28 @@ public class EMFTCSInjector {
private final Model model;
private final Metamodel metamodel;
- public EMFInjectorAdapter(Object model) {
+ public EMFInjectorAdapter(final Object model) {
this.emfModel = (EMFModel)model;
- this.model = EmftvmFactory.eINSTANCE.createModel();
if (emfModel.getResource() == null) {
// Trigger resource creation
- Object element = emfModel.newElement(EcorePackage.eINSTANCE.getEClass());
+ final Object element = emfModel.newElement(EcorePackage.eINSTANCE.getEClass());
emfModel.getResource().getContents().remove(element);
}
- this.model.setResource(emfModel.getResource());
- this.metamodel = EmftvmFactory.eINSTANCE.createMetamodel();
- this.metamodel.setResource(emfModel.getReferenceModel().getResource());
+ this.model = EmftvmFactory.eINSTANCE.createModel(emfModel.getResource());
+ this.metamodel = EmftvmFactory.eINSTANCE
+ .createMetamodel(emfModel.getReferenceModel().getResource());
}
public Object getModel() {
return this.emfModel;
}
- public Object get(Object modelElement, String name) {
+ public Object get(final Object modelElement, final String name) {
if (modelElement == null) {
return null;
} else {
- EObject eo = (EObject)modelElement;
- EStructuralFeature sf = eo.eClass().getEStructuralFeature(name);
+ final EObject eo = (EObject)modelElement;
+ final EStructuralFeature sf = eo.eClass().getEStructuralFeature(name);
if (sf == null) {
return null;
}
@@ -147,15 +144,15 @@ public class EMFTCSInjector {
}
}
- public Object createElement(String typeName) {
+ public Object createElement(final String typeName) {
return model.newElement(getTypeByName(typeName));
}
- public Set getElementsByType(String typeName) {
+ public Set getElementsByType(final String typeName) {
return model.allInstancesOf(getTypeByName(typeName)).asSet();
}
- public void set(Object modelElement, String name, Object value) {
+ public void set(final Object modelElement, final String name, Object value) {
if (value == null) {
return;
}
@@ -170,23 +167,23 @@ public class EMFTCSInjector {
// makes it possible to use an integer to set a floating point property
if (value instanceof Integer) {
- String targetType = feature.getEType().getInstanceClassName();
+ final String targetType = feature.getEType().getInstanceClassName();
if ("java.lang.Double".equals(targetType) || "java.lang.Float".equals(targetType)) { //$NON-NLS-1$ //$NON-NLS-2$
value = new Double(((Integer)value).doubleValue());
}
}
- EClassifier type = feature.getEType();
- boolean targetIsEnum = type instanceof EEnum;
+ final EClassifier type = feature.getEType();
+ final boolean targetIsEnum = type instanceof EEnum;
- Object oldValue = eo.eGet(feature);
+ final Object oldValue = eo.eGet(feature);
if (oldValue instanceof Collection) {
- Collection oldCol = (Collection)oldValue;
+ final Collection oldCol = (Collection)oldValue;
if (value instanceof Collection) {
if (targetIsEnum) {
- EEnum eenum = (EEnum)type;
- for (Iterator i = ((Collection)value).iterator(); i.hasNext();) {
- Object v = i.next();
+ final EEnum eenum = (EEnum)type;
+ for (final Iterator i = ((Collection)value).iterator(); i.hasNext();) {
+ final Object v = i.next();
oldCol.add(eenum.getEEnumLiteralByLiteral(v.toString()).getInstance());
}
} else {
@@ -194,7 +191,7 @@ public class EMFTCSInjector {
}
} else {
if (targetIsEnum) {
- EEnum eenum = (EEnum)type;
+ final EEnum eenum = (EEnum)type;
oldCol.add(eenum.getEEnumLiteralByLiteral(value.toString()).getInstance());
} else {
oldCol.add(value);
@@ -202,7 +199,7 @@ public class EMFTCSInjector {
}
} else {
if (value instanceof Collection) {
- Collection c = (Collection)value;
+ final Collection c = (Collection)value;
if (!c.isEmpty()) {
value = c.iterator().next();
} else {
@@ -210,9 +207,9 @@ public class EMFTCSInjector {
}
}
if (targetIsEnum) {
- EEnum eenum = (EEnum)type;
+ final EEnum eenum = (EEnum)type;
if (value != null) {
- EEnumLiteral literal = eenum.getEEnumLiteral(value.toString());
+ final EEnumLiteral literal = eenum.getEEnumLiteral(value.toString());
if (literal != null) {
eo.eSet(feature, literal.getInstance());
} else {
@@ -225,11 +222,11 @@ public class EMFTCSInjector {
}
}
- public boolean isCandidate(Object ame, String typeName) {
+ public boolean isCandidate(final Object ame, final String typeName) {
boolean ret = false;
- Object valueType = getTypeByName(typeName);
+ final Object valueType = getTypeByName(typeName);
- Object type = getType(ame);
+ final Object type = getType(ame);
if (valueType instanceof EObject) {
final EObject o = (EObject)valueType;
@@ -238,7 +235,7 @@ public class EMFTCSInjector {
if ((o instanceof EClass) && (t instanceof EClass)) {
try {
ret = o.equals(t) || ((EClass)o).isSuperTypeOf((EClass)t);
- } catch (Exception e) {
+ } catch (final Exception e) {
ATLLogger.log(Level.SEVERE, e.getLocalizedMessage(), e);
}
}
@@ -246,7 +243,7 @@ public class EMFTCSInjector {
return ret;
}
- public Object getType(Object value) {
+ public Object getType(final Object value) {
if (value instanceof EObject) {
return ((EObject)value).eClass();
} else if (value instanceof EList) {
@@ -256,21 +253,21 @@ public class EMFTCSInjector {
}
}
- public boolean isAModelElement(Object me) {
+ public boolean isAModelElement(final Object me) {
return me instanceof EObject;
}
- public String getString(Object ame, String propName) {
+ public String getString(final Object ame, final String propName) {
return get(ame, propName).toString();
}
- public Object createEnumLiteral(String name) {
- EEnumLiteral ret = EcoreFactoryImpl.eINSTANCE.createEEnumLiteral();
+ public Object createEnumLiteral(final String name) {
+ final EEnumLiteral ret = EcoreFactoryImpl.eINSTANCE.createEEnumLiteral();
ret.setName(name);
return ret;
}
- private EClass getTypeByName(String typeName) {
+ private EClass getTypeByName(final String typeName) {
final EClassifier type = metamodel.findType(typeName);
return type instanceof EClass ? (EClass)type : null;
}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm-feature/build.properties b/plugins/org.eclipse.m2m.atl.emftvm-feature/build.properties
index b86f4b41..1c4a68fd 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm-feature/build.properties
+++ b/plugins/org.eclipse.m2m.atl.emftvm-feature/build.properties
@@ -12,10 +12,11 @@ bin.includes = modeling32.png,\
epl-v20.html,\
feature.properties,\
feature.xml,\
- license.html
+ license.html,\
+ copyright.txt
src.includes = modeling32.png,\
epl-v20.html,\
feature.properties,\
feature.xml,\
- license.html
-
+ license.html,\
+ copyright.txt
diff --git a/plugins/org.eclipse.m2m.atl.emftvm-feature/copyright.txt b/plugins/org.eclipse.m2m.atl.emftvm-feature/copyright.txt
index 5394ff1e..b6fd2641 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm-feature/copyright.txt
+++ b/plugins/org.eclipse.m2m.atl.emftvm-feature/copyright.txt
@@ -1,4 +1,5 @@
-Copyright (c) 2011-2014 Dennis Wagelaar, Vrije Universiteit Brussel.
+Copyright (c) 2011-2012 Dennis Wagelaar, Vrije Universiteit Brussel.
+Copyright (c) 2012-2021 Dennis Wagelaar.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v2.0
which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.m2m.atl.emftvm-feature/feature.properties b/plugins/org.eclipse.m2m.atl.emftvm-feature/feature.properties
index a1277498..8f120386 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm-feature/feature.properties
+++ b/plugins/org.eclipse.m2m.atl.emftvm-feature/feature.properties
@@ -1,5 +1,6 @@
################################################################################
-# Copyright (c) 2011-2013 Vrije Universiteit Brussel.
+# Copyright (c) 2011-2012 Vrije Universiteit Brussel.
+# Copyright (c) 2012-2021 Dennis Wagelaar.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
@@ -7,6 +8,7 @@
#
# Contributors:
# Vrije Universiteit Brussel - initial API and implementation
+# Dennis Wagelaar
################################################################################
# "featureName" property - name of the feature
featureName = ATL EMFTVM
@@ -21,71 +23,13 @@ description = ATL EMFTVM.
ModelingUpdateSiteName=Eclipse Modeling
copyrightURL=copyright.txt
-copyright=Copyright (c) 2011-2014 Dennis Wagelaar, Vrije Universiteit Brussel.\n\
+copyright=Copyright (c) 2011-2012 Dennis Wagelaar, Vrije Universiteit Brussel.\n\
+Copyright (c) 2012-2021 Dennis Wagelaar.\n\
All rights reserved. This program and the accompanying materials\n\
are made available under the terms of the Eclipse Public License v2.0\n\
which accompanies this distribution, and is available at\n\
https://www.eclipse.org/legal/epl-2.0/
-# /**
-# * <copyright>
-# *
-# * Copyright (c) 2002, 2009 ATLAS Group (INRIA & LINA).
-# * All rights reserved. This program and the accompanying materials
-# * are made available under the terms of the Eclipse Public License v2.0
-# * which accompanies this distribution, and is available at
-# * https://www.eclipse.org/legal/epl-2.0/
-# *
-# * Contributors:
-# * ATLAS Group (INRIA & LINA)
-# *
-# * </copyright>
-# *
-# */
-
-# NLS_MESSAGEFORMAT_VAR
-
-# ==============================================================================
-# Do not change the properties between this line and the last line containing:
-# %%% END OF TRANSLATED PROPERTIES %%%
-# Instead, either redefine an existing property, or create a new property,
-# append it to the end of the file, and change the code to use the new name.
-# ==============================================================================
-
-# This file contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName = ATL - ATL Transformation Language
-
-# "providerName" property - name of the company that provides the feature
-providerName = Eclipse Modeling Project
-
-# "description" property - description of the feature
-description = ATL Runtime.
-
-# "updateSiteName" property - label for the update site
-ModelingUpdateSiteName=Eclipse Modeling
-
-# ==============================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# The above properties have been shipped for translation.
-# ==============================================================================
-
-copyrightURL = copyright.txt
-copyright = Copyright (c) 2004, 2009 INRIA. \n\
-All rights reserved. This program and the accompanying materials \n\
-are made available under the terms of the Eclipse Public License v2.0 \n\
-which accompanies this distribution, and is available at \n\
-https://www.eclipse.org/legal/epl-2.0/ \n\
- \n\
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
# "licenseURL" property - URL of the "Feature License"
# do not translate value - just change to point to a locale-specific HTML page
licenseURL=license.html
diff --git a/plugins/org.eclipse.m2m.atl.emftvm-feature/feature.xml b/plugins/org.eclipse.m2m.atl.emftvm-feature/feature.xml
index 4cb1f086..4944e885 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm-feature/feature.xml
+++ b/plugins/org.eclipse.m2m.atl.emftvm-feature/feature.xml
@@ -7,7 +7,7 @@
plugin="org.eclipse.m2m.atl.emftvm">
<description>
- ATL EMFTVM
+ %description
</description>
<copyright url="%copyrightURL">
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/LoadMetamodelTask.java b/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/LoadMetamodelTask.java
index 105ea12b..28e4309b 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/LoadMetamodelTask.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/LoadMetamodelTask.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright (c) 2011 Vrije Universiteit Brussel.
+ * Copyright (c) 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -11,6 +12,7 @@
*******************************************************************************/
package org.eclipse.m2m.atl.emftvm.ant;
+import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.m2m.atl.emftvm.EmftvmFactory;
import org.eclipse.m2m.atl.emftvm.Metamodel;
import org.eclipse.m2m.atl.emftvm.Model;
@@ -19,7 +21,6 @@ import org.eclipse.m2m.atl.emftvm.util.EMFTVMUtil;
/**
* Loads a {@link Metamodel}.
* @author <a href="mailto:dennis.wagelaar@vub.ac.be">Dennis Wagelaar</a>
- *
*/
public class LoadMetamodelTask extends LoadModelTask {
@@ -27,8 +28,8 @@ public class LoadMetamodelTask extends LoadModelTask {
* {@inheritDoc}
*/
@Override
- protected Model createModel() {
- return EmftvmFactory.eINSTANCE.createMetamodel();
+ protected Model createModel(final Resource resource) {
+ return EmftvmFactory.eINSTANCE.createMetamodel(resource);
}
/**
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/LoadModelTask.java b/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/LoadModelTask.java
index 6d25211e..94533873 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/LoadModelTask.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/LoadModelTask.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright (c) 2011 Vrije Universiteit Brussel.
+ * Copyright (c) 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -95,11 +96,13 @@ public class LoadModelTask extends EMFTVMTask {
}
/**
- * Creates a new {@link Model} instance.
+ * Creates a new {@link Model} instance for the given {@link Resource}.
+ *
+ * @param resource the {@link Resource}
* @return a new {@link Model}.
*/
- protected Model createModel() {
- return EmftvmFactory.eINSTANCE.createModel();
+ protected Model createModel(Resource resource) {
+ return EmftvmFactory.eINSTANCE.createModel(resource);
}
/**
@@ -128,8 +131,7 @@ public class LoadModelTask extends EMFTVMTask {
if (r == null) {
throw new IllegalArgumentException(String.format("Model with uri %s could not be found", uri));
}
- final Model m = createModel();
- m.setResource(r);
+ final Model m = createModel(r);
setModel(getName(), m);
}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/NewModelTask.java b/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/NewModelTask.java
index 6a1f6670..e7cde6cc 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/NewModelTask.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/NewModelTask.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright (c) 2011 Vrije Universiteit Brussel.
+ * Copyright (c) 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -35,8 +36,7 @@ public class NewModelTask extends LoadModelTask {
if (r == null) {
throw new IllegalArgumentException(String.format("Model with uri %s could not be created", uri));
}
- final Model m = createModel();
- m.setResource(r);
+ final Model m = createModel(r);
setModel(getName(), m);
}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/RunTask.java b/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/RunTask.java
index 9286e9ed..daf3a8f2 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/RunTask.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm.ant/src_ant/org/eclipse/m2m/atl/emftvm/ant/RunTask.java
@@ -47,7 +47,7 @@ public class RunTask extends EMFTVMTask {
return FILE_EXT.matcher(resource.getName()).replaceAll("");
}
- private static String generateFilename(final List<String> inputFileNames, String suffix) {
+ private static String generateFilename(final List<String> inputFileNames, final String suffix) {
final StringBuilder sb = new StringBuilder();
for (final String fileName : inputFileNames) {
if (sb.length() > 0) {
@@ -77,7 +77,7 @@ public class RunTask extends EMFTVMTask {
*
* @param module the module to set
*/
- public void setModule(String module) {
+ public void setModule(final String module) {
this.module = module;
}
@@ -95,7 +95,7 @@ public class RunTask extends EMFTVMTask {
*
* @param modulePath the modulePath to set
*/
- public void setModulePath(String modulePath) {
+ public void setModulePath(final String modulePath) {
this.modulePath = modulePath;
}
@@ -122,7 +122,7 @@ public class RunTask extends EMFTVMTask {
*
* @param disableJIT whether to disable the JIT compiler
*/
- public void setDisableJIT(boolean disableJIT) {
+ public void setDisableJIT(final boolean disableJIT) {
this.disableJIT = disableJIT;
}
@@ -194,7 +194,7 @@ public class RunTask extends EMFTVMTask {
*
* @param metamodel the metamodel
*/
- public void addConfiguredMetamodel(MetaModel metamodel) {
+ public void addConfiguredMetamodel(final MetaModel metamodel) {
getMetaModels().add(metamodel);
}
@@ -203,7 +203,7 @@ public class RunTask extends EMFTVMTask {
*
* @param model the input model
*/
- public void addConfiguredInputModel(InModel model) {
+ public void addConfiguredInputModel(final InModel model) {
getInputModels().add(model);
}
@@ -212,7 +212,7 @@ public class RunTask extends EMFTVMTask {
*
* @param model the in/out model
*/
- public void addConfiguredInoutModel(InOutModel model) {
+ public void addConfiguredInoutModel(final InOutModel model) {
getInoutModels().add(model);
}
@@ -221,7 +221,7 @@ public class RunTask extends EMFTVMTask {
*
* @param model the output model
*/
- public void addConfiguredOutputModel(OutModel model) {
+ public void addConfiguredOutputModel(final OutModel model) {
getOutputModels().add(model);
}
@@ -230,7 +230,7 @@ public class RunTask extends EMFTVMTask {
*
* @param modelSet the input model set
*/
- public void addConfiguredInputModelSet(InModelSet modelSet) {
+ public void addConfiguredInputModelSet(final InModelSet modelSet) {
getInputModelSets().add(modelSet);
}
@@ -239,7 +239,7 @@ public class RunTask extends EMFTVMTask {
*
* @param modelSet the in/out model set
*/
- public void addConfiguredInoutModelSet(InOutModelSet modelSet) {
+ public void addConfiguredInoutModelSet(final InOutModelSet modelSet) {
getInoutModelSets().add(modelSet);
}
@@ -248,7 +248,7 @@ public class RunTask extends EMFTVMTask {
*
* @param modelSet the output model set
*/
- public void addConfiguredOutputModelSet(OutModelSet modelSet) {
+ public void addConfiguredOutputModelSet(final OutModelSet modelSet) {
getOutputModelSets().add(modelSet);
}
@@ -425,8 +425,7 @@ public class RunTask extends EMFTVMTask {
final String u = m.getUri();
final URI uri = u == null ? URI.createPlatformResourceURI(m.getWspath(), true) : URI.createURI(u);
final Resource r = rs.createResource(uri);
- model = EmftvmFactory.eINSTANCE.createModel();
- model.setResource(r);
+ model = EmftvmFactory.eINSTANCE.createModel(r);
model.setAllowInterModelReferences(m.isAllowInterModelReferences());
setModel(m.getName(), model);
} else {
@@ -457,8 +456,7 @@ public class RunTask extends EMFTVMTask {
final String u = m.getUri();
final URI uri = u == null ? URI.createPlatformResourceURI(m.getWspath(), true) : URI.createURI(u);
final Resource r = rs.createResource(uri);
- final Model model = EmftvmFactory.eINSTANCE.createModel();
- model.setResource(r);
+ final Model model = EmftvmFactory.eINSTANCE.createModel(r);
model.setAllowInterModelReferences(m.isAllowInterModelReferences());
setModel(m.getName(), model);
env.registerOutputModel(getModelKey(m), model);
@@ -481,9 +479,7 @@ public class RunTask extends EMFTVMTask {
throw new IllegalArgumentException(
String.format("Model with filename %s could not be found", resource.getName()));
}
- final Model m = EmftvmFactory.eINSTANCE.createModel();
- m.setResource(r);
- return m;
+ return EmftvmFactory.eINSTANCE.createModel(r);
}
private Model createFromResource(final File dir, final org.apache.tools.ant.types.Resource resource) {
@@ -492,8 +488,6 @@ public class RunTask extends EMFTVMTask {
}
final ResourceSet rs = getResourceSet();
final Resource r = rs.createResource(URI.createFileURI(new File(dir, resource.getName()).getPath()));
- final Model m = EmftvmFactory.eINSTANCE.createModel();
- m.setResource(r);
- return m;
+ return EmftvmFactory.eINSTANCE.createModel(r);
}
}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/.project b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/.project
new file mode 100644
index 00000000..5cc37f11
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2m.atl.emftvm.cdo-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/build.properties b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/build.properties
new file mode 100644
index 00000000..1c4a68fd
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/build.properties
@@ -0,0 +1,22 @@
+################################################################################
+# Copyright (c) 2011-2012 Dennis Wagelaar, Vrije Universiteit Brussel.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Vrije Universiteit Brussel - initial API and implementation
+################################################################################
+bin.includes = modeling32.png,\
+ epl-v20.html,\
+ feature.properties,\
+ feature.xml,\
+ license.html,\
+ copyright.txt
+src.includes = modeling32.png,\
+ epl-v20.html,\
+ feature.properties,\
+ feature.xml,\
+ license.html,\
+ copyright.txt
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/copyright.txt b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/copyright.txt
new file mode 100644
index 00000000..5ac4e953
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/copyright.txt
@@ -0,0 +1,5 @@
+Copyright (c) 2021 Dennis Wagelaar.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v2.0
+which accompanies this distribution, and is available at
+https://www.eclipse.org/legal/epl-2.0/ \ No newline at end of file
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/epl-v20.html b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/epl-v20.html
new file mode 100644
index 00000000..99a83880
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/epl-v20.html
@@ -0,0 +1,300 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!-- saved from url=(0058)https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+
+ <title>Eclipse Public License - Version 2.0</title>
+ <style type="text/css">
+ body {
+ margin: 1.5em 3em;
+ }
+ h1{
+ font-size:1.5em;
+ }
+ h2{
+ font-size:1em;
+ margin-bottom:0.5em;
+ margin-top:1em;
+ }
+ p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ ul, ol{
+ list-style-type:none;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>Eclipse Public License - v 2.0</h1>
+ <p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+ PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION
+ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ </p>
+ <h2 id="definitions">1. DEFINITIONS</h2>
+ <p>“Contribution” means:</p>
+ <ul>
+ <li>a) in the case of the initial Contributor, the initial content
+ Distributed under this Agreement, and
+ </li>
+ <li>
+ b) in the case of each subsequent Contributor:
+ <ul>
+ <li>i) changes to the Program, and</li>
+ <li>ii) additions to the Program;</li>
+ </ul>
+ where such changes and/or additions to the Program originate from
+ and are Distributed by that particular Contributor. A Contribution
+ “originates” from a Contributor if it was added to the Program by such
+ Contributor itself or anyone acting on such Contributor's behalf.
+ Contributions do not include changes or additions to the Program that
+ are not Modified Works.
+ </li>
+ </ul>
+ <p>“Contributor” means any person or entity that Distributes the Program.</p>
+ <p>“Licensed Patents” mean patent claims licensable by a Contributor which
+ are necessarily infringed by the use or sale of its Contribution alone
+ or when combined with the Program.
+ </p>
+ <p>“Program” means the Contributions Distributed in accordance with this
+ Agreement.
+ </p>
+ <p>“Recipient” means anyone who receives the Program under this Agreement
+ or any Secondary License (as applicable), including Contributors.
+ </p>
+ <p>“Derivative Works” shall mean any work, whether in Source Code or other
+ form, that is based on (or derived from) the Program and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship.
+ </p>
+ <p>“Modified Works” shall mean any work in Source Code or other form that
+ results from an addition to, deletion from, or modification of the
+ contents of the Program, including, for purposes of clarity any new file
+ in Source Code form that contains any contents of the Program. Modified
+ Works shall not include works that contain only declarations, interfaces,
+ types, classes, structures, or files of the Program solely in each case
+ in order to link to, bind by name, or subclass the Program or Modified
+ Works thereof.
+ </p>
+ <p>“Distribute” means the acts of a) distributing or b) making available
+ in any manner that enables the transfer of a copy.
+ </p>
+ <p>“Source Code” means the form of a Program preferred for making
+ modifications, including but not limited to software source code,
+ documentation source, and configuration files.
+ </p>
+ <p>“Secondary License” means either the GNU General Public License,
+ Version 2.0, or any later versions of that license, including any
+ exceptions or additional permissions as identified by the initial
+ Contributor.
+ </p>
+ <h2 id="grant-of-rights">2. GRANT OF RIGHTS</h2>
+ <ul>
+ <li>a) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
+ license to reproduce, prepare Derivative Works of, publicly display,
+ publicly perform, Distribute and sublicense the Contribution of such
+ Contributor, if any, and such Derivative Works.
+ </li>
+ <li>b) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
+ license under Licensed Patents to make, use, sell, offer to sell,
+ import and otherwise transfer the Contribution of such Contributor,
+ if any, in Source Code or other form. This patent license shall
+ apply to the combination of the Contribution and the Program if,
+ at the time the Contribution is added by the Contributor, such
+ addition of the Contribution causes such combination to be covered
+ by the Licensed Patents. The patent license shall not apply to any
+ other combinations which include the Contribution. No hardware per
+ se is licensed hereunder.
+ </li>
+ <li>c) Recipient understands that although each Contributor grants the
+ licenses to its Contributions set forth herein, no assurances are
+ provided by any Contributor that the Program does not infringe the
+ patent or other intellectual property rights of any other entity.
+ Each Contributor disclaims any liability to Recipient for claims
+ brought by any other entity based on infringement of intellectual
+ property rights or otherwise. As a condition to exercising the rights
+ and licenses granted hereunder, each Recipient hereby assumes sole
+ responsibility to secure any other intellectual property rights needed,
+ if any. For example, if a third party patent license is required to
+ allow Recipient to Distribute the Program, it is Recipient's
+ responsibility to acquire that license before distributing the Program.
+ </li>
+ <li>d) Each Contributor represents that to its knowledge it has sufficient
+ copyright rights in its Contribution, if any, to grant the copyright
+ license set forth in this Agreement.
+ </li>
+ <li>e) Notwithstanding the terms of any Secondary License, no Contributor
+ makes additional grants to any Recipient (other than those set forth
+ in this Agreement) as a result of such Recipient's receipt of the
+ Program under the terms of a Secondary License (if permitted under
+ the terms of Section 3).
+ </li>
+ </ul>
+ <h2 id="requirements">3. REQUIREMENTS</h2>
+ <p>3.1 If a Contributor Distributes the Program in any form, then:</p>
+ <ul>
+ <li>a) the Program must also be made available as Source Code, in
+ accordance with section 3.2, and the Contributor must accompany
+ the Program with a statement that the Source Code for the Program
+ is available under this Agreement, and informs Recipients how to
+ obtain it in a reasonable manner on or through a medium customarily
+ used for software exchange; and
+ </li>
+ <li>
+ b) the Contributor may Distribute the Program under a license
+ different than this Agreement, provided that such license:
+ <ul>
+ <li>i) effectively disclaims on behalf of all other Contributors all
+ warranties and conditions, express and implied, including warranties
+ or conditions of title and non-infringement, and implied warranties
+ or conditions of merchantability and fitness for a particular purpose;
+ </li>
+ <li>ii) effectively excludes on behalf of all other Contributors all
+ liability for damages, including direct, indirect, special, incidental
+ and consequential damages, such as lost profits;
+ </li>
+ <li>iii) does not attempt to limit or alter the recipients' rights in the
+ Source Code under section 3.2; and
+ </li>
+ <li>iv) requires any subsequent distribution of the Program by any party
+ to be under a license that satisfies the requirements of this section 3.
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <p>3.2 When the Program is Distributed as Source Code:</p>
+ <ul>
+ <li>a) it must be made available under this Agreement, or if the Program (i)
+ is combined with other material in a separate file or files made available
+ under a Secondary License, and (ii) the initial Contributor attached to
+ the Source Code the notice described in Exhibit A of this Agreement,
+ then the Program may be made available under the terms of such
+ Secondary Licenses, and
+ </li>
+ <li>b) a copy of this Agreement must be included with each copy of the Program.</li>
+ </ul>
+ <p>3.3 Contributors may not remove or alter any copyright, patent, trademark,
+ attribution notices, disclaimers of warranty, or limitations of liability
+ (‘notices’) contained within the Program from any copy of the Program which
+ they Distribute, provided that Contributors may add their own appropriate
+ notices.
+ </p>
+ <h2 id="commercial-distribution">4. COMMERCIAL DISTRIBUTION</h2>
+ <p>Commercial distributors of software may accept certain responsibilities
+ with respect to end users, business partners and the like. While this
+ license is intended to facilitate the commercial use of the Program, the
+ Contributor who includes the Program in a commercial product offering should
+ do so in a manner which does not create potential liability for other
+ Contributors. Therefore, if a Contributor includes the Program in a
+ commercial product offering, such Contributor (“Commercial Contributor”)
+ hereby agrees to defend and indemnify every other Contributor
+ (“Indemnified Contributor”) against any losses, damages and costs
+ (collectively “Losses”) arising from claims, lawsuits and other legal actions
+ brought by a third party against the Indemnified Contributor to the extent
+ caused by the acts or omissions of such Commercial Contributor in connection
+ with its distribution of the Program in a commercial product offering.
+ The obligations in this section do not apply to any claims or Losses relating
+ to any actual or alleged intellectual property infringement. In order to
+ qualify, an Indemnified Contributor must: a) promptly notify the
+ Commercial Contributor in writing of such claim, and b) allow the Commercial
+ Contributor to control, and cooperate with the Commercial Contributor in,
+ the defense and any related settlement negotiations. The Indemnified
+ Contributor may participate in any such claim at its own expense.
+ </p>
+ <p>For example, a Contributor might include the Program
+ in a commercial product offering, Product X. That Contributor is then a
+ Commercial Contributor. If that Commercial Contributor then makes performance
+ claims, or offers warranties related to Product X, those performance claims
+ and warranties are such Commercial Contributor's responsibility alone.
+ Under this section, the Commercial Contributor would have to defend claims
+ against the other Contributors related to those performance claims and
+ warranties, and if a court requires any other Contributor to pay any damages
+ as a result, the Commercial Contributor must pay those damages.
+ </p>
+ <h2 id="warranty">5. NO WARRANTY</h2>
+ <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
+ BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+ WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+ solely responsible for determining the appropriateness of using and
+ distributing the Program and assumes all risks associated with its
+ exercise of rights under this Agreement, including but not limited to the
+ risks and costs of program errors, compliance with applicable laws, damage
+ to or loss of data, programs or equipment, and unavailability or
+ interruption of operations.
+ </p>
+ <h2 id="disclaimer">6. DISCLAIMER OF LIABILITY</h2>
+ <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
+ BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY
+ LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS),
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+ GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ </p>
+ <h2 id="general">7. GENERAL</h2>
+ <p>If any provision of this Agreement is invalid or unenforceable under
+ applicable law, it shall not affect the validity or enforceability of the
+ remainder of the terms of this Agreement, and without further action by the
+ parties hereto, such provision shall be reformed to the minimum extent
+ necessary to make such provision valid and enforceable.
+ </p>
+ <p>If Recipient institutes patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Program itself
+ (excluding combinations of the Program with other software or hardware)
+ infringes such Recipient's patent(s), then such Recipient's rights granted
+ under Section 2(b) shall terminate as of the date such litigation is filed.
+ </p>
+ <p>All Recipient's rights under this Agreement shall terminate if it fails to
+ comply with any of the material terms or conditions of this Agreement and
+ does not cure such failure in a reasonable period of time after becoming
+ aware of such noncompliance. If all Recipient's rights under this Agreement
+ terminate, Recipient agrees to cease use and distribution of the Program
+ as soon as reasonably practicable. However, Recipient's obligations under
+ this Agreement and any licenses granted by Recipient relating to the
+ Program shall continue and survive.
+ </p>
+ <p>Everyone is permitted to copy and distribute copies of this Agreement,
+ but in order to avoid inconsistency the Agreement is copyrighted and may
+ only be modified in the following manner. The Agreement Steward reserves
+ the right to publish new versions (including revisions) of this Agreement
+ from time to time. No one other than the Agreement Steward has the right
+ to modify this Agreement. The Eclipse Foundation is the initial Agreement
+ Steward. The Eclipse Foundation may assign the responsibility to serve as
+ the Agreement Steward to a suitable separate entity. Each new version of
+ the Agreement will be given a distinguishing version number. The Program
+ (including Contributions) may always be Distributed subject to the version
+ of the Agreement under which it was received. In addition, after a new
+ version of the Agreement is published, Contributor may elect to Distribute
+ the Program (including its Contributions) under the new version.
+ </p>
+ <p>Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
+ receives no rights or licenses to the intellectual property of any
+ Contributor under this Agreement, whether expressly, by implication,
+ estoppel or otherwise. All rights in the Program not expressly granted
+ under this Agreement are reserved. Nothing in this Agreement is intended
+ to be enforceable by any entity that is not a Contributor or Recipient.
+ No third-party beneficiary rights are created under this Agreement.
+ </p>
+ <h2 id="exhibit-a">Exhibit A – Form of Secondary Licenses Notice</h2>
+ <p>“This Source Code may also be made available under the following
+ Secondary Licenses when the conditions for such availability set forth
+ in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
+ version(s), and exceptions or additional permissions here}.”
+ </p>
+ <blockquote>
+ <p>Simply including a copy of this Agreement, including this Exhibit A
+ is not sufficient to license the Source Code under Secondary Licenses.
+ </p>
+ <p>If it is not possible or desirable to put the notice in a particular file,
+ then You may include the notice in a location (such as a LICENSE file in a
+ relevant directory) where a recipient would be likely to look for
+ such a notice.
+ </p>
+ <p>You may add additional accurate notices of copyright ownership.</p>
+ </blockquote>
+
+<div id="eid-chrome-extension-is-installed"></div></body></html> \ No newline at end of file
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/feature.properties b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/feature.properties
new file mode 100644
index 00000000..c7df7cfb
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/feature.properties
@@ -0,0 +1,177 @@
+################################################################################
+# Copyright (c) 2021 Dennis Wagelaar.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# Contributors:
+# Dennis Wagelaar - initial API and implementation
+################################################################################
+# "featureName" property - name of the feature
+featureName = ATL EMFTVM CDO support
+
+# "providerName" property - name of the company that provides the feature
+providerName = Eclipse Modeling Project
+
+# "description" property - description of the feature
+description = ATL EMFTVM CDO support.
+
+# "updateSiteName" property - label for the update site
+ModelingUpdateSiteName=Eclipse Modeling
+
+copyrightURL=copyright.txt
+copyright=Copyright (c) 2021 Dennis Wagelaar.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License v2.0\n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=\
+Eclipse Foundation Software User Agreement\n\
+\n\
+November 22, 2017\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION\n\
+AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF\n\
+THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE\n\
+TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED\n\
+BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE\n\
+AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY\n\
+APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU\n\
+MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
+is provided to you under the terms and conditions of the Eclipse Public License\n\
+Version 2.0 ("EPL"). A copy of the EPL is provided with this Content and is also\n\
+available at http://www.eclipse.org/legal/epl-2.0. For purposes of the EPL,\n\
+"Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code, documentation\n\
+and other files maintained in the Eclipse Foundation source code repository\n\
+("Repository") in software modules ("Modules") and made available as\n\
+downloadable archives ("Downloads").\n\
+\n\
+- Content may be structured and packaged into modules to facilitate\n\
+ delivering, extending, and upgrading the Content. Typical modules may\n\
+ include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and\n\
+ features ("Features").\n\
+- Each Plug-in or Fragment may be packaged as a sub-directory or JAR\n\
+ (Java\u2122 ARchive) in a directory named "plugins".\n\
+- A Feature is a bundle of one or more Plug-ins and/or Fragments and\n\
+ associated material. Each Feature may be packaged as a sub-directory in a\n\
+ directory named "features". Within a Feature, files named "feature.xml" may\n\
+ contain a list of the names and version numbers of the Plug-ins and/or\n\
+ Fragments associated with that Feature.\n\
+- Features may also include other Features ("Included Features"). Within a\n\
+ Feature, files named "feature.xml" may contain a list of the names and\n\
+ version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be contained in\n\
+files named "about.html" ("Abouts"). The terms and conditions governing Features\n\
+and Included Features should be contained in files named "license.html"\n\
+("Feature Licenses"). Abouts and Feature Licenses may be located in any\n\
+directory of a Download or Module including, but not limited to the following\n\
+locations:\n\
+\n\
+- The top-level (root) directory\n\
+- Plug-in and Fragment directories\n\
+- Inside Plug-ins and Fragments packaged as JARs\n\
+- Sub-directories of the directory named "src" of certain Plug-ins\n\
+- Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using\n\
+the Provisioning Technology (as defined below), you must agree to a license\n\
+("Feature Update License") during the installation process. If the Feature\n\
+contains Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform you\n\
+where you can locate them. Feature Update Licenses may be found in the "license"\n\
+property of files named "feature.properties" found within a Feature. Such\n\
+Abouts, Feature Licenses, and Feature Update Licenses contain the terms and\n\
+conditions (or references to such terms and conditions) that govern your use of\n\
+the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL\n\
+OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE\n\
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+- Eclipse Public License Version 1.0 (available at\n\
+ http://www.eclipse.org/legal/epl-v10.html)\n\
+- Eclipse Distribution License Version 1.0 (available at\n\
+ http://www.eclipse.org/licenses/edl-v1.0.html)\n\
+- Common Public License Version 1.0 (available at\n\
+ http://www.eclipse.org/legal/cpl-v10.html)\n\
+- Apache Software License 1.1 (available at\n\
+ http://www.apache.org/licenses/LICENSE)\n\
+- Apache Software License 2.0 (available at\n\
+ http://www.apache.org/licenses/LICENSE-2.0)\n\
+- Mozilla Public License Version 1.1 (available at\n\
+ http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO\n\
+USE OF THE CONTENT. If no About, Feature License, or Feature Update License is\n\
+provided, please contact the Eclipse Foundation to determine what terms and\n\
+conditions govern that particular Content.\n\
+\n\
+Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which\n\
+include, but are not limited to, p2 and the Eclipse Update Manager\n\
+("Provisioning Technology") for the purpose of allowing users to install\n\
+software, documentation, information and/or other materials (collectively\n\
+"Installable Software"). This capability is provided with the intent of allowing\n\
+such users to install, extend and update Eclipse-based products. Information\n\
+about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install\n\
+Installable Software. You shall be responsible for enabling the applicable\n\
+license agreements relating to the Installable Software to be presented to, and\n\
+accepted by, the users of the Provisioning Technology in accordance with the\n\
+Specification. By using Provisioning Technology in such a manner and making it\n\
+available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the\n\
+following:\n\
+\n\
+1. A series of actions may occur ("Provisioning Process") in which a user may\n\
+ execute the Provisioning Technology on a machine ("Target Machine") with the\n\
+ intent of installing, extending or updating the functionality of an\n\
+ Eclipse-based product.\n\
+2. During the Provisioning Process, the Provisioning Technology may cause third\n\
+ party Installable Software or a portion thereof to be accessed and copied to\n\
+ the Target Machine.\n\
+3. Pursuant to the Specification, you will provide to the user the terms and\n\
+ conditions that govern the use of the Installable Software ("Installable\n\
+ Software Agreement") and such Installable Software Agreement shall be\n\
+ accessed from the Target Machine in accordance with the Specification. Such\n\
+ Installable Software Agreement must inform the user of the terms and\n\
+ conditions that govern the Installable Software and must solicit acceptance\n\
+ by the end user in the manner prescribed in such Installable\n\
+ Software Agreement. Upon such indication of agreement by the user, the\n\
+ provisioning Technology will complete installation of the\n\
+ Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are currently\n\
+may have restrictions on the import, possession, and use, and/or re-export to\n\
+another country, of encryption software. BEFORE using any encryption software,\n\
+please check the country's laws, regulations and policies concerning the import,\n\
+possession, or use, and re-export of encryption software, to see if this is\n\
+permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the\n\
+United States, other countries, or both.\n
+########### end of license property ##########################################
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/feature.xml b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/feature.xml
new file mode 100644
index 00000000..2793cab1
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/feature.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.m2m.atl.emftvm.cdo"
+ label="%featureName"
+ version="4.4.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.eclipse.m2m.atl.emftvm.cdo">
+
+ <description>
+ %description
+ </description>
+
+ <copyright url="%copyrightURL">
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="%ModelingUpdateSiteName" url="http://www.eclipse.org/modeling/updates/"/>
+ <discovery label="%ModelingUpdateSiteName" url="http://www.eclipse.org/modeling/updates/"/>
+ </url>
+
+ <plugin
+ id="org.eclipse.m2m.atl.emftvm.cdo"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.m2m.atl.emftvm.cdo.source"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/license.html b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/license.html
new file mode 100644
index 00000000..afb2f35c
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/license.html
@@ -0,0 +1,190 @@
+
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+ <h2>Eclipse Foundation Software User Agreement</h2>
+ <p>November 22, 2017</p>
+
+ <h3>Usage Of Content</h3>
+
+ <p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION,
+ INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY
+ THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
+ BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS
+ GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY
+ APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
+ BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS
+ AGREEMENT AND THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
+ AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT
+ USE THE CONTENT.</p>
+
+ <h3>Applicable Licenses</h3>
+
+ <p>
+ Unless otherwise indicated, all Content made available by the Eclipse
+ Foundation is provided to you under the terms and conditions of the
+ Eclipse Public License Version 2.0 (&quot;EPL&quot;). A copy of the
+ EPL is provided with this Content and is also available at <a
+ href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.
+ </p>
+
+ <p>Content includes, but is not limited to, source code, object
+ code, documentation and other files maintained in the Eclipse
+ Foundation source code repository (&quot;Repository&quot;) in software
+ modules (&quot;Modules&quot;) and made available as downloadable
+ archives (&quot;Downloads&quot;).</p>
+
+ <ul>
+ <li>Content may be structured and packaged into modules to
+ facilitate delivering, extending, and upgrading the Content. Typical
+ modules may include plug-ins (&quot;Plug-ins&quot;), plug-in
+ fragments (&quot;Fragments&quot;), and features
+ (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory
+ or JAR (Java&trade; ARchive) in a directory named
+ &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or
+ Fragments and associated material. Each Feature may be packaged as a
+ sub-directory in a directory named &quot;features&quot;. Within a
+ Feature, files named &quot;feature.xml&quot; may contain a list of
+ the names and version numbers of the Plug-ins and/or Fragments
+ associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included
+ Features&quot;). Within a Feature, files named
+ &quot;feature.xml&quot; may contain a list of the names and version
+ numbers of Included Features.</li>
+ </ul>
+
+ <p>The terms and conditions governing Plug-ins and Fragments should
+ be contained in files named &quot;about.html&quot;
+ (&quot;Abouts&quot;). The terms and conditions governing Features and
+ Included Features should be contained in files named
+ &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and
+ Feature Licenses may be located in any directory of a Download or
+ Module including, but not limited to the following locations:</p>
+
+ <ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of
+ certain Plug-ins</li>
+ <li>Feature directories</li>
+ </ul>
+
+ <p>Note: if a Feature made available by the Eclipse Foundation is
+ installed using the Provisioning Technology (as defined below), you
+ must agree to a license (&quot;Feature Update License&quot;) during
+ the installation process. If the Feature contains Included Features,
+ the Feature Update License should either provide you with the terms
+ and conditions governing the Included Features or inform you where you
+ can locate them. Feature Update Licenses may be found in the
+ &quot;license&quot; property of files named
+ &quot;feature.properties&quot; found within a Feature. Such Abouts,
+ Feature Licenses, and Feature Update Licenses contain the terms and
+ conditions (or references to such terms and conditions) that govern
+ your use of the associated Content in that directory.</p>
+
+ <p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY
+ REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND
+ CONDITIONS. SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT
+ ARE NOT LIMITED TO):</p>
+
+ <ul>
+ <li>Eclipse Public License Version 1.0 (available at <a
+ href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>)
+ </li>
+ <li>Eclipse Distribution License Version 1.0 (available at <a
+ href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)
+ </li>
+ <li>Common Public License Version 1.0 (available at <a
+ href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)
+ </li>
+ <li>Apache Software License 1.1 (available at <a
+ href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)
+ </li>
+ <li>Apache Software License 2.0 (available at <a
+ href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)
+ </li>
+ <li>Mozilla Public License Version 1.1 (available at <a
+ href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)
+ </li>
+ </ul>
+
+ <p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND
+ CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License,
+ or Feature Update License is provided, please contact the Eclipse
+ Foundation to determine what terms and conditions govern that
+ particular Content.</p>
+
+
+ <h3>Use of Provisioning Technology</h3>
+
+ <p>
+ The Eclipse Foundation makes available provisioning software, examples
+ of which include, but are not limited to, p2 and the Eclipse Update
+ Manager (&quot;Provisioning Technology&quot;) for the purpose of
+ allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This
+ capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about
+ packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).
+ </p>
+
+ <p>You may use Provisioning Technology to allow other parties to
+ install Installable Software. You shall be responsible for enabling
+ the applicable license agreements relating to the Installable Software
+ to be presented to, and accepted by, the users of the Provisioning
+ Technology in accordance with the Specification. By using Provisioning
+ Technology in such a manner and making it available in accordance with
+ the Specification, you further acknowledge your agreement to, and the
+ acquisition of all necessary rights to permit the following:</p>
+
+ <ol>
+ <li>A series of actions may occur (&quot;Provisioning
+ Process&quot;) in which a user may execute the Provisioning
+ Technology on a machine (&quot;Target Machine&quot;) with the intent
+ of installing, extending or updating the functionality of an
+ Eclipse-based product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology
+ may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user
+ the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such
+ Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable
+ Software Agreement must inform the user of the terms and conditions
+ that govern the Installable Software and must solicit acceptance by
+ the end user in the manner prescribed in such Installable Software
+ Agreement. Upon such indication of agreement by the user, the
+ provisioning Technology will complete installation of the Installable
+ Software.</li>
+ </ol>
+
+ <h3>Cryptography</h3>
+
+ <p>Content may contain encryption software. The country in which
+ you are currently may have restrictions on the import, possession, and
+ use, and/or re-export to another country, of encryption software.
+ BEFORE using any encryption software, please check the country's laws,
+ regulations and policies concerning the import, possession, or use,
+ and re-export of encryption software, to see if this is permitted.</p>
+
+ <p>
+ <small>Java and all Java-based trademarks are trademarks of
+ Oracle Corporation in the United States, other countries, or both.</small>
+ </p>
+</body>
+</html>
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/modeling32.png b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/modeling32.png
new file mode 100644
index 00000000..6b08de2a
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/modeling32.png
Binary files differ
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/pom.xml b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/pom.xml
new file mode 100644
index 00000000..f70eb909
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo-feature/pom.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2012 Obeo.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v2.0
+ which accompanies this distribution, and is available at
+ https://www.eclipse.org/legal/epl-2.0/
+
+ Contributors:
+ Obeo - initial creator
+ -->
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>m2m.atl-parent</artifactId>
+ <groupId>org.eclipse.m2m.atl</groupId>
+ <version>4.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.m2m.atl.releng.parent</relativePath>
+ </parent>
+ <groupId>org.eclipse.m2m.atl.features</groupId>
+ <artifactId>org.eclipse.m2m.atl.emftvm.cdo</artifactId>
+ <version>4.4.0-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+
+</project>
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/.classpath b/plugins/org.eclipse.m2m.atl.emftvm.cdo/.classpath
new file mode 100644
index 00000000..64c5e31b
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/.project b/plugins/org.eclipse.m2m.atl.emftvm.cdo/.project
new file mode 100644
index 00000000..faa08034
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2m.atl.emftvm.cdo</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.m2m.atl.emftvm.cdo/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..95221b95
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/META-INF/MANIFEST.MF b/plugins/org.eclipse.m2m.atl.emftvm.cdo/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..8fd5d26b
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/META-INF/MANIFEST.MF
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.m2m.atl.emftvm.cdo;singleton:=true
+Bundle-Version: 4.4.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.eclipse.emf.ecore.xmi;bundle-version="2.4.0";visibility:=reexport,
+ org.eclipse.m2m.atl.emftvm;visibility:=reexport,
+ org.eclipse.emf.cdo;bundle-version="4.13.0",
+ org.eclipse.m2m.atl.common
+Bundle-ActivationPolicy: lazy
+Automatic-Module-Name: org.eclipse.m2m.atl.emftvm.cdo
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/OSGI-INF/l10n/bundle.properties b/plugins/org.eclipse.m2m.atl.emftvm.cdo/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000..2298d3fe
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.m2m.atl.emftvm.cdo
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = ATL EMFTVM CDO Adapter \ No newline at end of file
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/about.html b/plugins/org.eclipse.m2m.atl.emftvm.cdo/about.html
new file mode 100644
index 00000000..15c4457b
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>March 23rd, 2021</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="https://www.eclipse.org/legal/epl-2.0/">https://www.eclipse.org/legal/epl-2.0/</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/about.ini b/plugins/org.eclipse.m2m.atl.emftvm.cdo/about.ini
new file mode 100755
index 00000000..d232c3d2
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/about.ini
@@ -0,0 +1,14 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%aboutText
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=modeling32.png
+
+# Property "appName" contains name of the application (translated)
+appName=%appName \ No newline at end of file
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/about.properties b/plugins/org.eclipse.m2m.atl.emftvm.cdo/about.properties
new file mode 100755
index 00000000..33ce52fe
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/about.properties
@@ -0,0 +1,9 @@
+appName=EMFTVM CDO Support
+
+aboutText=EMFTVM CDO Support Plug-in\n\
+Version: {featureVersion}\n\
+\n\
+(c) Copyright 2021 Dennis Wagelaar.\n\
+\n\
+This plug-in provides support for ATL/EMFTVM optimized traversal of CDO models.\n\
+Visit: http://wiki.eclipse.org/ATL/EMFTVM \ No newline at end of file
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/build.properties b/plugins/org.eclipse.m2m.atl.emftvm.cdo/build.properties
new file mode 100644
index 00000000..dbe70212
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/build.properties
@@ -0,0 +1,10 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ OSGI-INF/,\
+ about.html,\
+ about.ini,\
+ about.properties,\
+ modeling32.png
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/deploy/release/pom.xml b/plugins/org.eclipse.m2m.atl.emftvm.cdo/deploy/release/pom.xml
new file mode 100644
index 00000000..8e4da71f
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/deploy/release/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.eclipse.m2m.atl</groupId>
+ <artifactId>org.eclipse.m2m.atl.emftvm.cdo</artifactId>
+ <version>4.4.0</version>
+ <packaging>jar</packaging>
+ <licenses>
+ <license>
+ <name>Eclipse Public License - v 1.0</name>
+ <url>http://www.eclipse.org/org/documents/epl-v10.html</url>
+ </license>
+ </licenses>
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.m2m.atl</groupId>
+ <artifactId>org.eclipse.m2m.atl.common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.m2m.atl</groupId>
+ <artifactId>org.eclipse.m2m.atl.emftvm</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>org.eclipse.emf.ecore.xmi</artifactId>
+ <version>[2.4,3.0)</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>org.eclipse.emf.cdo</artifactId>
+ <version>[4.0,5.0)</version>
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/deploy/snapshot/pom.xml b/plugins/org.eclipse.m2m.atl.emftvm.cdo/deploy/snapshot/pom.xml
new file mode 100644
index 00000000..d508a8c6
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/deploy/snapshot/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.eclipse.m2m.atl</groupId>
+ <artifactId>org.eclipse.m2m.atl.emftvm.cdo</artifactId>
+ <version>4.4.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <licenses>
+ <license>
+ <name>Eclipse Public License - v 1.0</name>
+ <url>http://www.eclipse.org/org/documents/epl-v10.html</url>
+ </license>
+ </licenses>
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.m2m.atl</groupId>
+ <artifactId>org.eclipse.m2m.atl.common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.m2m.atl</groupId>
+ <artifactId>org.eclipse.m2m.atl.emftvm</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>org.eclipse.emf.ecore.xmi</artifactId>
+ <version>[2.4,3.0)</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>org.eclipse.emf.cdo</artifactId>
+ <version>[4.0,5.0)</version>
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/modeling32.png b/plugins/org.eclipse.m2m.atl.emftvm.cdo/modeling32.png
new file mode 100644
index 00000000..6b08de2a
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/modeling32.png
Binary files differ
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/plugin.xml b/plugins/org.eclipse.m2m.atl.emftvm.cdo/plugin.xml
new file mode 100644
index 00000000..aeef1846
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/plugin.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ id="org.eclipse.m2m.atl.emftvm.cdo.impl.CDOModelFactory"
+ point="org.eclipse.m2m.atl.emftvm.modelfactory">
+ <modelfactory
+ class="org.eclipse.m2m.atl.emftvm.cdo.impl.CDOModelFactoryImpl"
+ resourceType="org.eclipse.emf.cdo.eresource.CDOResource">
+ </modelfactory>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/pom.xml b/plugins/org.eclipse.m2m.atl.emftvm.cdo/pom.xml
new file mode 100644
index 00000000..a292b030
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/pom.xml
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2012 Obeo.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v2.0
+ which accompanies this distribution, and is available at
+ https://www.eclipse.org/legal/epl-2.0/
+
+ Contributors:
+ Obeo - initial creator
+ -->
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>m2m.atl-parent</artifactId>
+ <groupId>org.eclipse.m2m.atl</groupId>
+ <version>4.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.m2m.atl.releng.parent</relativePath>
+ </parent>
+ <groupId>org.eclipse.m2m.atl</groupId>
+ <artifactId>org.eclipse.m2m.atl.emftvm.cdo</artifactId>
+ <version>4.4.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>stable</id>
+ <activation>
+ <property>
+ <name>BUILD_TYPE</name>
+ <value>S</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>deploy-custom</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>deploy-file</goal>
+ </goals>
+ <configuration>
+ <file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
+ <files>${project.build.directory}/${project.artifactId}-${project.version}-sources.jar</files>
+ <classifiers>sources</classifiers>
+ <repositoryId>${project.distributionManagement.snapshotRepository.id}</repositoryId>
+ <url>${project.distributionManagement.snapshotRepository.url}</url>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${project.artifactId}</artifactId>
+ <version>${project.version}</version>
+ <packaging>jar</packaging>
+ <pomFile>${project.basedir}/deploy/snapshot/pom.xml</pomFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>release</id>
+ <activation>
+ <property>
+ <name>BUILD_TYPE</name>
+ <value>R</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>deploy-custom</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>deploy-file</goal>
+ </goals>
+ <configuration>
+ <file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
+ <files>${project.build.directory}/${project.artifactId}-${project.version}-sources.jar</files>
+ <classifiers>sources</classifiers>
+ <repositoryId>${project.distributionManagement.repository.id}</repositoryId>
+ <url>${project.distributionManagement.repository.url}</url>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${project.artifactId}</artifactId>
+ <version>${project.releaseVersion}</version>
+ <packaging>jar</packaging>
+ <pomFile>${project.basedir}/deploy/release/pom.xml</pomFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOInstanceOfIterable.java b/plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOInstanceOfIterable.java
new file mode 100644
index 00000000..88fd67ec
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOInstanceOfIterable.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2021 Dennis Wagelaar.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * Contributors:
+ * Dennis Wagelaar - initial API and
+ * implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.m2m.atl.emftvm.cdo.impl;
+
+import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.view.CDOQuery;
+import org.eclipse.emf.cdo.view.CDOView;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.net4j.util.collection.CloseableIterator;
+
+/**
+ * Makes the instances of the given {@link EClass} in a {@link CDOResource}
+ * available as an {@link Iterable}.
+ *
+ * @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
+ */
+public class CDOInstanceOfIterable implements Iterable<EObject> {
+
+ private final CDOResource res;
+ private final EClass type;
+
+ /**
+ * Creates a new {@link CDOInstanceOfIterable} around <code>res</code> and
+ * <code>type</code>.
+ *
+ * @param res the resource
+ * @param type the EClass
+ */
+ public CDOInstanceOfIterable(final CDOResource res, final EClass type) {
+ this.res = res;
+ this.type = type;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public CloseableIterator<EObject> iterator() {
+ final CDOView cdoView = res.cdoView();
+ final CDOQuery query = cdoView.createQuery(CDOProtocolConstants.QUERY_LANGUAGE_INSTANCES, null);
+ query.setParameter(CDOProtocolConstants.QUERY_LANGUAGE_INSTANCES_TYPE, type);
+ query.setParameter(CDOProtocolConstants.QUERY_LANGUAGE_INSTANCES_EXACT, false);
+ return query.getResultAsync();
+ }
+
+}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOMetamodelImpl.java b/plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOMetamodelImpl.java
new file mode 100644
index 00000000..933af696
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOMetamodelImpl.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2021 Dennis Wagelaar.
+ * 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:
+ * Dennis Wagelaar - initial API and
+ * implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.m2m.atl.emftvm.cdo.impl;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.m2m.atl.common.ATLLogger;
+import org.eclipse.m2m.atl.emftvm.EmftvmPackage;
+import org.eclipse.m2m.atl.emftvm.Metamodel;
+import org.eclipse.m2m.atl.emftvm.impl.MetamodelImpl;
+
+/**
+ * CDO implementation of {@link Metamodel}.
+ *
+ * @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
+ */
+public class CDOMetamodelImpl extends CDOModelImpl implements Metamodel {
+
+ /**
+ * Lookup table of ((type name) -> (type)).
+ */
+ protected Map<String, EClassifier> types;
+
+ /**
+ * Set of ambiguous type names (more than one occurrence).
+ */
+ protected Set<String> ambiguousTypes = new HashSet<String>();
+
+ /**
+ * Returns the {@link EClass} that correspond to this metaclass.
+ *
+ * @return the {@link EClass} that correspond to this metaclass.
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return EmftvmPackage.Literals.METAMODEL;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public synchronized EClassifier findType(final String typeName) {
+ if (types == null) {
+ types = createTypeTable(ambiguousTypes);
+ }
+ final EClassifier type = types.get(typeName);
+ if (type == null) {
+ throw new IllegalArgumentException(String.format("Type %s not found in metamodel %s", typeName, this));
+ }
+ if (ambiguousTypes.contains(typeName)) {
+ ATLLogger.warning(String.format("Metamodel %s contains more than one type with name %s", this, typeName));
+ }
+ return type;
+ }
+
+ /**
+ * Returns a new type lookup table.
+ *
+ * @param ambiguousTypes the set of ambiguous type names (more than one
+ * occurrence)
+ * @return A new type lookup table.
+ */
+ private Map<String, EClassifier> createTypeTable(final Set<String> ambiguousTypes) {
+ final Map<String, EClassifier> types = new HashMap<String, EClassifier>();
+ final Resource res = getResource();
+ assert res != null;
+ MetamodelImpl.registerTypeChain(types, res, null, new HashSet<Object>(), ambiguousTypes);
+ return types;
+ }
+
+}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOModelFactoryImpl.java b/plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOModelFactoryImpl.java
new file mode 100644
index 00000000..a4532826
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOModelFactoryImpl.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2021 Dennis Wagelaar.
+ * 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:
+ * Dennis Wagelaar - initial API and
+ * implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.m2m.atl.emftvm.cdo.impl;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.m2m.atl.emftvm.Metamodel;
+import org.eclipse.m2m.atl.emftvm.Model;
+import org.eclipse.m2m.atl.emftvm.ModelFactory;
+
+/**
+ * CDO implementation for {@link ModelFactory}.
+ *
+ * @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
+ */
+public class CDOModelFactoryImpl implements ModelFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Model createModel(final Resource resource) {
+ final Model model = new CDOModelImpl();
+ model.setResource(resource);
+ return model;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Metamodel createMetamodel(final Resource resource) {
+ final Metamodel metaModel = new CDOMetamodelImpl();
+ metaModel.setResource(resource);
+ return metaModel;
+ }
+
+}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOModelImpl.java b/plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOModelImpl.java
new file mode 100644
index 00000000..5f5db717
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm.cdo/src/org/eclipse/m2m/atl/emftvm/cdo/impl/CDOModelImpl.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2021 Dennis Wagelaar.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * Contributors:
+ * Dennis Wagelaar - initial API and
+ * implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.m2m.atl.emftvm.cdo.impl;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.m2m.atl.emftvm.Model;
+import org.eclipse.m2m.atl.emftvm.impl.ModelImpl;
+import org.eclipse.m2m.atl.emftvm.util.LazyList;
+import org.eclipse.m2m.atl.emftvm.util.LazyList.NonCachingList;
+
+/**
+ * CDO implementation of {@link Model}.
+ *
+ * @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
+ */
+public class CDOModelImpl extends ModelImpl {
+
+ /**
+ * {@link LazyList} that returns only instances within a given {@link Resource}.
+ *
+ * @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
+ */
+ public static class InResourceList extends NonCachingList<EObject> {
+
+ /**
+ * {@link Iterator} for {@link InResourceList}.
+ *
+ * @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
+ */
+ public class InResourceIterator extends WrappedIterator {
+
+ protected EObject next = null;
+ protected boolean nextSet = false;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean hasNext() {
+ if (!nextSet && inner.hasNext()) {
+ next = inner.next(); // support null values for next
+ nextSet = true;
+ }
+ while (inner.hasNext() && (next == null || next.eResource() != resource)) {
+ next = inner.next();
+ }
+ return nextSet && next != null && next.eResource() == resource;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EObject next() {
+ if (!nextSet) {
+ next = inner.next(); // support null values for next
+ } else {
+ nextSet = false;
+ }
+ while (next.eResource() != resource) {
+ next = inner.next();
+ }
+ assert !nextSet && next.eResource() == resource;
+ return next;
+ }
+ }
+
+ protected final Resource resource;
+
+ /**
+ * Creates a new {@link InResourceList} around <code>dataSource</code>.
+ *
+ * @param dataSource the underlying data source
+ * @param resource the resource of which to return the instances
+ */
+ public InResourceList(final Iterable<EObject> dataSource, final Resource resource) {
+ super(dataSource);
+ this.resource = resource;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Iterator<EObject> iterator() {
+ if (dataSource == null) { // cache complete
+ return cache.iterator();
+ }
+ return new InResourceIterator();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setResource(final Resource newResource) {
+ if (newResource != null && !(newResource instanceof CDOResource)) {
+ throw new IllegalArgumentException("Resource should be a CDOResource, but was: " + newResource);
+ }
+ super.setResource(newResource);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public LazyList<EObject> allInstancesOf(final EClass type) {
+ if (!allInstancesMap.containsKey(type)) {
+ allInstancesMap.put(type,
+ new InResourceList(new CDOInstanceOfIterable((CDOResource) getResource(), type), getResource()));
+ }
+ return allInstancesMap.get(type);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EObject newElement(final EClass type) {
+ final EObject instance = type.getEPackage().getEFactoryInstance().create(type);
+ getResource().getContents().add(instance);
+ assert instance.eResource() == getResource();
+ return instance;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void deleteElement(final EObject element) {
+ assert getResource() == element.eResource();
+ final EList<EObject> resContents = getResource().getContents();
+ if (!resContents.remove(element)) {
+ throw new IllegalArgumentException(
+ String.format("Element %s not contained as a root element in this model", element));
+ }
+ for (final EObject child : new ArrayList<EObject>(element.eContents())) {
+ assert child.eResource() == null;
+ // adding children to a container removes them from their previous container
+ resContents.add(child);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.compiler/src/org/eclipse/m2m/atl/emftvm/compiler/AtlToEmftvmCompiler.java b/plugins/org.eclipse.m2m.atl.emftvm.compiler/src/org/eclipse/m2m/atl/emftvm/compiler/AtlToEmftvmCompiler.java
index 539ccc2c..04c754fc 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.compiler/src/org/eclipse/m2m/atl/emftvm/compiler/AtlToEmftvmCompiler.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm.compiler/src/org/eclipse/m2m/atl/emftvm/compiler/AtlToEmftvmCompiler.java
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright (c) 2011 Vrije Universiteit Brussel.
- * Copyright (c) 2017-2018 Dennis Wagelaar.
+ * Copyright (c) 2017, 2018, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -58,13 +58,13 @@ import org.eclipse.m2m.atl.engine.parser.AtlParser;
/**
* Invokes the ATL to EMFTVM compiler.
- *
+ *
* @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
*/
public class AtlToEmftvmCompiler implements AtlStandaloneCompiler {
protected final ResourceSet rs = new ResourceSetImpl();
- protected final Metamodel pbmm = EmftvmFactory.eINSTANCE.createMetamodel();
+ protected final Metamodel pbmm;
protected final ExecEnvPool atlWfrPool = new ExecEnvPool();
protected final ExecEnvPool atlToEmftvmPool = new ExecEnvPool();
protected final ExecEnvPool inlineCodeblocksPool = new ExecEnvPool();
@@ -80,9 +80,10 @@ public class AtlToEmftvmCompiler implements AtlStandaloneCompiler {
*/
rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("emftvm", new EMFTVMResourceFactoryImpl());
- final Metamodel atlmm = EmftvmFactory.eINSTANCE.createMetamodel();
- atlmm.setResource(((EMFReferenceModel) AtlParser.getDefault().getAtlMetamodel()).getResource());
- pbmm.setResource(((EMFReferenceModel) AtlParser.getDefault().getProblemMetamodel()).getResource());
+ final Metamodel atlmm = EmftvmFactory.eINSTANCE
+ .createMetamodel(((EMFReferenceModel) AtlParser.getDefault().getAtlMetamodel()).getResource());
+ pbmm = EmftvmFactory.eINSTANCE
+ .createMetamodel(((EMFReferenceModel) AtlParser.getDefault().getProblemMetamodel()).getResource());
final ModuleResolverFactory mrf = createModuleResolverFactory();
atlWfrPool.setModuleResolverFactory(mrf);
@@ -102,7 +103,7 @@ public class AtlToEmftvmCompiler implements AtlStandaloneCompiler {
/**
* Creates a new {@link ModuleResolverFactory}.
- *
+ *
* @return a new {@link ModuleResolverFactory}
*/
protected ModuleResolverFactory createModuleResolverFactory() {
@@ -115,7 +116,7 @@ public class AtlToEmftvmCompiler implements AtlStandaloneCompiler {
public ModuleResolver createModuleResolver() {
return new ClassModuleResolver(getClass()) {
@Override
- public Module resolveModule(String module) throws ModuleNotFoundException {
+ public Module resolveModule(final String module) throws ModuleNotFoundException {
return super.resolveModule("/transformations/" + module);
}
};
@@ -211,16 +212,13 @@ public class AtlToEmftvmCompiler implements AtlStandaloneCompiler {
public EObject[] compileWithProblemModel(final IModel atlModel, final OutputStream outputStream) {
final List<EObject> pbs = new ArrayList<EObject>();
- final Model atlm = EmftvmFactory.eINSTANCE.createModel();
- atlm.setResource(((EMFModel) atlModel).getResource());
+ final Model atlm = EmftvmFactory.eINSTANCE.createModel(((EMFModel) atlModel).getResource());
final Resource pr = rs.createResource(URI.createFileURI("problems.xmi"));
- final Model pbm = EmftvmFactory.eINSTANCE.createModel();
- pbm.setResource(pr);
+ final Model pbm = EmftvmFactory.eINSTANCE.createModel(pr);
final Resource r = rs.createResource(URI.createFileURI("out.emftvm"), "org.eclipse.m2m.atl.emftvm");
- final Model emftvmm = EmftvmFactory.eINSTANCE.createModel();
- emftvmm.setResource(r);
+ final Model emftvmm = EmftvmFactory.eINSTANCE.createModel(r);
final ExecEnv atlWfrEnv = atlWfrPool.getExecEnv();
final ExecEnv atlToEmftvmEnv = atlToEmftvmPool.getExecEnv();
@@ -281,7 +279,7 @@ public class AtlToEmftvmCompiler implements AtlStandaloneCompiler {
/**
* Retrieves problem elements from <code>problems</code>.
- *
+ *
* @param problems
* the problems model
* @param pbElements
@@ -309,7 +307,7 @@ public class AtlToEmftvmCompiler implements AtlStandaloneCompiler {
/**
* Retrieves problem elements from <code>problems</code>.
- *
+ *
* @param problems
* the problems model
* @param pbElements
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.launcher/src/org/eclipse/m2m/atl/emftvm/launcher/EMFTVMLaunchConfigurationDelegate.java b/plugins/org.eclipse.m2m.atl.emftvm.launcher/src/org/eclipse/m2m/atl/emftvm/launcher/EMFTVMLaunchConfigurationDelegate.java
index 23f68639..546af597 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.launcher/src/org/eclipse/m2m/atl/emftvm/launcher/EMFTVMLaunchConfigurationDelegate.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm.launcher/src/org/eclipse/m2m/atl/emftvm/launcher/EMFTVMLaunchConfigurationDelegate.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright (c) 2011 Vrije Universiteit Brussel.
+ * Copyright (c) 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -56,8 +57,7 @@ import org.eclipse.m2m.atl.emftvm.util.VMMonitor;
* Launches EMFTVM transformation modules.
* @author <a href="mailto:dennis.wagelaar@vub.ac.be">Dennis Wagelaar</a>
*/
-public class EMFTVMLaunchConfigurationDelegate implements
- ILaunchConfigurationDelegate {
+public class EMFTVMLaunchConfigurationDelegate implements ILaunchConfigurationDelegate {
/**
* Creates a new {@link EMFTVMLaunchConfigurationDelegate}.
@@ -69,6 +69,7 @@ public class EMFTVMLaunchConfigurationDelegate implements
/**
* {@inheritDoc}
*/
+ @Override
public void launch(final ILaunchConfiguration configuration, final String mode,
final ILaunch launch, final IProgressMonitor monitor) throws CoreException {
ATLConsole.findConsole(); // force ATL console startup
@@ -88,20 +89,20 @@ public class EMFTVMLaunchConfigurationDelegate implements
try {
try {
internalLaunch(configuration, mode, launch, monitor);
- } catch (CoreException e) {
+ } catch (final CoreException e) {
EmftvmLauncherPlugin.log(e.getStatus());
- } catch (VMException e) {
+ } catch (final VMException e) {
ATLLogger.severe(e.toString());
- } catch (Exception e) {
+ } catch (final Exception e) {
ATLLogger.severe(e.toString());
EmftvmLauncherPlugin.log(e);
- } catch (AssertionError e) {
+ } catch (final AssertionError e) {
ATLLogger.severe(e.toString());
EmftvmLauncherPlugin.log(e);
} finally {
target.terminate();
}
- } catch (CoreException e) {
+ } catch (final CoreException e) {
EmftvmLauncherPlugin.log(e.getStatus());
}
}
@@ -114,7 +115,7 @@ public class EMFTVMLaunchConfigurationDelegate implements
launch.addDebugTarget(target);
monitor.done();
}
-
+
@SuppressWarnings("unchecked")
private void internalLaunch(final ILaunchConfiguration configuration, final String mode,
final ILaunch launch, final IProgressMonitor monitor) throws CoreException, IOException {
@@ -133,21 +134,21 @@ public class EMFTVMLaunchConfigurationDelegate implements
env.setJitDisabled(configuration.getAttribute(EMFTVMLaunchConstants.DISABLE_JIT, false));
env.setMonitor(vmmon);
final ResourceSet rs = new ResourceSetImpl();
-
+
final Map<String, String> metamodelLocations = configuration.getAttribute(EMFTVMLaunchConstants.METAMODELS, Collections.EMPTY_MAP);
final Map<String, String> metamodelOptions = configuration.getAttribute(EMFTVMLaunchConstants.METAMODEL_OPTIONS, Collections.EMPTY_MAP);
loadFileMetaModels(rs, metamodelLocations, metamodelOptions, env);
EMFTVMUtil.registerEPackages(rs);
-
+
final Map<String, String> inputModelLocations = configuration.getAttribute(EMFTVMLaunchConstants.INPUT_MODELS, Collections.EMPTY_MAP);
final Map<String, String> inputModelOptions = configuration.getAttribute(EMFTVMLaunchConstants.INPUT_MODEL_OPTIONS, Collections.EMPTY_MAP);
loadInputModels(rs, inputModelLocations, inputModelOptions, env);
-
+
final Map<String, String> inoutModelLocations = configuration.getAttribute(EMFTVMLaunchConstants.INOUT_MODELS, Collections.EMPTY_MAP);
final Map<String, String> inoutModelOutLocations = configuration.getAttribute(EMFTVMLaunchConstants.INOUT_OUT_MODELS, Collections.EMPTY_MAP);
final Map<String, String> inoutModelOptions = configuration.getAttribute(EMFTVMLaunchConstants.INOUT_MODEL_OPTIONS, Collections.EMPTY_MAP);
loadInOutModels(rs, inoutModelLocations, inoutModelOptions, env);
-
+
final Map<String, String> outputModelLocations = configuration.getAttribute(EMFTVMLaunchConstants.OUTPUT_MODELS, Collections.EMPTY_MAP);
final Map<String, String> outputModelOptions = configuration.getAttribute(EMFTVMLaunchConstants.OUTPUT_MODEL_OPTIONS, Collections.EMPTY_MAP);
createOutputModels(rs, outputModelLocations, outputModelOptions, env);
@@ -181,7 +182,7 @@ public class EMFTVMLaunchConfigurationDelegate implements
final Map<String, String> emptyMap = Collections.emptyMap();
saveModels(env.getOutputModels(), outputModelOptions, emptyMap);
}
-
+
/**
* Loads all metamodels that have a file or platform URI from <code>modelLocations</code> into <code>env</code>.
* @param rs the resource set to use
@@ -189,11 +190,11 @@ public class EMFTVMLaunchConfigurationDelegate implements
* @param modelOptions map of additional model options
* @param env the {@link ExecEnv} to register the metamodels in
*/
- private void loadFileMetaModels(final ResourceSet rs, final Map<String, String> modelLocations,
+ private void loadFileMetaModels(final ResourceSet rs, final Map<String, String> modelLocations,
final Map<String, String> modelOptions,
final ExecEnv env) {
- for (Entry<String, String> entry : modelLocations.entrySet()) {
- URI uri = URI.createURI((String)entry.getValue());
+ for (final Entry<String, String> entry : modelLocations.entrySet()) {
+ final URI uri = URI.createURI(entry.getValue());
if (uri.isFile() || uri.isPlatform()) {
Resource r;
if (getBoolOption(modelOptions, entry.getKey(), EMFTVMLaunchConstants.OPT_IS_METAMETAMODEL)) {
@@ -201,9 +202,8 @@ public class EMFTVMLaunchConfigurationDelegate implements
} else {
r = rs.getResource(uri, true);
}
- Metamodel m = EmftvmFactory.eINSTANCE.createMetamodel();
- m.setResource(r);
- env.registerMetaModel((String)entry.getKey(), m);
+ final Metamodel m = EmftvmFactory.eINSTANCE.createMetamodel(r);
+ env.registerMetaModel(entry.getKey(), m);
}
}
}
@@ -215,11 +215,11 @@ public class EMFTVMLaunchConfigurationDelegate implements
* @param modelOptions map of additional model options
* @param env the {@link ExecEnv} to register the metamodels in
*/
- private void loadOtherMetaModels(final ResourceSet rs, final Map<String, String> modelLocations,
+ private void loadOtherMetaModels(final ResourceSet rs, final Map<String, String> modelLocations,
final Map<String, String> modelOptions,
final ExecEnv env) {
- for (Entry<String, String> entry : modelLocations.entrySet()) {
- URI uri = URI.createURI((String)entry.getValue());
+ for (final Entry<String, String> entry : modelLocations.entrySet()) {
+ final URI uri = URI.createURI(entry.getValue());
if (!uri.isFile() && !uri.isPlatform()) {
Resource r;
if (getBoolOption(modelOptions, entry.getKey(), EMFTVMLaunchConstants.OPT_IS_METAMETAMODEL)) {
@@ -227,9 +227,8 @@ public class EMFTVMLaunchConfigurationDelegate implements
} else {
r = rs.getResource(uri, true);
}
- Metamodel m = EmftvmFactory.eINSTANCE.createMetamodel();
- m.setResource(r);
- env.registerMetaModel((String)entry.getKey(), m);
+ final Metamodel m = EmftvmFactory.eINSTANCE.createMetamodel(r);
+ env.registerMetaModel(entry.getKey(), m);
}
}
}
@@ -241,26 +240,25 @@ public class EMFTVMLaunchConfigurationDelegate implements
* @param modelOptions the map of model options
* @return the loaded {@link Model}
*/
- private Model loadModel(final ResourceSet rs, final Entry<String, String> entry,
+ private Model loadModel(final ResourceSet rs, final Entry<String, String> entry,
final Map<String, String> modelOptions) {
final Resource r;
if (getBoolOption(
- modelOptions,
- entry.getKey(),
+ modelOptions,
+ entry.getKey(),
EMFTVMLaunchConstants.OPT_CREATE_NEW_MODEL)) {
r = rs.createResource(URI.createURI(entry.getValue()));
} else {
r = rs.getResource(URI.createURI(entry.getValue()), true);
}
- final Model m = EmftvmFactory.eINSTANCE.createModel();
- m.setResource(r);
+ final Model m = EmftvmFactory.eINSTANCE.createModel(r);
m.setAllowInterModelReferences(getBoolOption(
- modelOptions,
- entry.getKey(),
+ modelOptions,
+ entry.getKey(),
EMFTVMLaunchConstants.OPT_ALLOW_INTER_MODEL_REFERENCES));
return m;
}
-
+
/**
* Loads all models from <code>modelLocations</code> into <code>env</code>.
* @param rs the resource set to use
@@ -271,11 +269,11 @@ public class EMFTVMLaunchConfigurationDelegate implements
private void loadInputModels(final ResourceSet rs, final Map<String, String> modelLocations,
final Map<String, String> modelOptions,
final ExecEnv env) {
- for (Entry<String, String> entry : modelLocations.entrySet()) {
+ for (final Entry<String, String> entry : modelLocations.entrySet()) {
env.registerInputModel(entry.getKey(), loadModel(rs, entry, modelOptions));
}
}
-
+
/**
* Loads all models from <code>modelLocations</code> into <code>env</code>.
* @param rs the resource set to use
@@ -286,11 +284,11 @@ public class EMFTVMLaunchConfigurationDelegate implements
private void loadInOutModels(final ResourceSet rs, final Map<String, String> modelLocations,
final Map<String, String> modelOptions,
final ExecEnv env) {
- for (Entry<String, String> entry : modelLocations.entrySet()) {
+ for (final Entry<String, String> entry : modelLocations.entrySet()) {
env.registerInOutModel(entry.getKey(), loadModel(rs, entry, modelOptions));
}
}
-
+
/**
* Creates new models for all models from <code>modelLocations</code> in <code>env</code>.
* @param rs the resource set to use
@@ -298,16 +296,15 @@ public class EMFTVMLaunchConfigurationDelegate implements
* @param modelOptions map of additional model options
* @param env the {@link ExecEnv} to register the models in
*/
- private void createOutputModels(final ResourceSet rs, final Map<String, String> modelLocations,
+ private void createOutputModels(final ResourceSet rs, final Map<String, String> modelLocations,
final Map<String, String> modelOptions,
final ExecEnv env) {
- for (Entry<String, String> entry : modelLocations.entrySet()) {
- Resource r = rs.createResource(URI.createURI(entry.getValue()));
- Model m = EmftvmFactory.eINSTANCE.createModel();
- m.setResource(r);
+ for (final Entry<String, String> entry : modelLocations.entrySet()) {
+ final Resource r = rs.createResource(URI.createURI(entry.getValue()));
+ final Model m = EmftvmFactory.eINSTANCE.createModel(r);
m.setAllowInterModelReferences(getBoolOption(
- modelOptions,
- entry.getKey(),
+ modelOptions,
+ entry.getKey(),
EMFTVMLaunchConstants.OPT_ALLOW_INTER_MODEL_REFERENCES));
env.registerOutputModel(entry.getKey(), m);
}
@@ -318,26 +315,26 @@ public class EMFTVMLaunchConfigurationDelegate implements
* @param models
* @param modelOptions map of additional model options
* @param modelLocations map of alternative model output locations
- * @throws IOException
- * @throws CoreException
+ * @throws IOException
+ * @throws CoreException
*/
@SuppressWarnings("deprecation")
- private void saveModels(final Map<String, Model> models,
+ private void saveModels(final Map<String, Model> models,
final Map<String, String> modelOptions,
final Map<String, String> modelLocations) throws IOException, CoreException {
final IWorkspaceRoot wr = ResourcesPlugin.getWorkspace().getRoot();
- for (Entry<String, Model> model : models.entrySet()) {
+ for (final Entry<String, Model> model : models.entrySet()) {
if (modelLocations.containsKey(model.getKey())) {
model.getValue().getResource().setURI(URI.createURI(modelLocations.get(model.getKey())));
}
model.getValue().getResource().save(Collections.emptyMap());
- URI uri = model.getValue().getResource().getURI();
+ final URI uri = model.getValue().getResource().getURI();
if (uri.isPlatformResource()) {
- IResource r = wr.findMember(uri.toPlatformString(true));
+ final IResource r = wr.findMember(uri.toPlatformString(true));
if (r instanceof IFile && getBoolOption(
- modelOptions,
- model.getKey(),
- EMFTVMLaunchConstants.OPT_DERIVED_FILE)) {
+ modelOptions,
+ model.getKey(),
+ EMFTVMLaunchConstants.OPT_DERIVED_FILE)) {
((IFile)r).setDerived(true);
}
}
@@ -375,7 +372,7 @@ public class EMFTVMLaunchConfigurationDelegate implements
modelOptions.put(modelName, (options + ' ' + option).trim());
}
}
-
+
/**
* Unsets the boolean value of <code>option</code> for <code>modelName</code> from <code>modelOptions</code>.
* @param modelOptions the model options map
@@ -396,7 +393,7 @@ public class EMFTVMLaunchConfigurationDelegate implements
* @return the {@link NetworkDebugger} port.
* @throws CoreException
*/
- public static int getPort(ILaunch launch) throws CoreException {
+ public static int getPort(final ILaunch launch) throws CoreException {
String portOption = ""; //$NON-NLS-1$
if (launch != null) {
portOption = launch.getLaunchConfiguration().getAttribute(ATLLaunchConstants.PORT,
@@ -419,5 +416,5 @@ public class EMFTVMLaunchConfigurationDelegate implements
}
return resolver;
}
-
+
}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/about.properties b/plugins/org.eclipse.m2m.atl.emftvm/about.properties
index eff498bf..00683675 100755
--- a/plugins/org.eclipse.m2m.atl.emftvm/about.properties
+++ b/plugins/org.eclipse.m2m.atl.emftvm/about.properties
@@ -3,7 +3,8 @@ appName=EMF Transformation Virtual Machine
aboutText=EMF Transformation Virtual Machine Plug-in\n\
Version: {featureVersion}\n\
\n\
-(c) Copyright 2011-2014 Dennis Wagelaar, Vrije Universiteit Brussel.\n\
+(c) Copyright 2011-2012 Dennis Wagelaar, Vrije Universiteit Brussel.\n\
+(c) Copyright 2012-2021 Dennis Wagelaar.\n\
\n\
The ATL EMF Transformation Virtual Machine (EMFTVM) provides a new, low-level\n\
model manipulation bytecode language that is based on an Ecore metamodel, as well as\n\
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/plugin.xml b/plugins/org.eclipse.m2m.atl.emftvm/plugin.xml
index f7ac3259..5e692430 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/plugin.xml
+++ b/plugins/org.eclipse.m2m.atl.emftvm/plugin.xml
@@ -3,11 +3,11 @@
<!--
(C) 2011, Vrije Universiteit Brussel
-
- $Id: plugin.xml,v 1.3 2012/01/02 11:49:41 dwagelaar Exp $
+ (C) 2021, Dennis Wagelaar
-->
<plugin>
+ <extension-point id="modelfactory" name="ATL/EMFTVM Model Factory" schema="schema/modelfactory.exsd"/>
<extension point="org.eclipse.emf.ecore.generated_package">
<package
@@ -103,5 +103,12 @@
context="org.eclipse.m2m.atl.emftvm.clientContext">
</binding>
</extension>
+ <extension
+ id="default"
+ point="org.eclipse.m2m.atl.emftvm.modelfactory">
+ <modelfactory
+ class="org.eclipse.m2m.atl.emftvm.impl.ModelFactoryImpl">
+ </modelfactory>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/schema/modelfactory.exsd b/plugins/org.eclipse.m2m.atl.emftvm/schema/modelfactory.exsd
new file mode 100644
index 00000000..7eb28a06
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm/schema/modelfactory.exsd
@@ -0,0 +1,96 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2m.atl.emftvm" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.m2m.atl.emftvm" id="modelfactory" name="ATL/EMFTVM Model Factory"/>
+ </appInfo>
+ <documentation>
+ ATL/EMFTVM Custom Model Factory extension point.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="modelfactory"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="modelfactory">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ The ModelFactory class supplied by the extension.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.m2m.atl.emftvm.ModelFactory"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="resourceType" type="string">
+ <annotation>
+ <documentation>
+ The EMF Resource interface/class supported by the provided ModelFactory.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.ecore.resource.Resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 4.4.0
+ </documentation>
+ </annotation>
+
+
+
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ (C) 2021, Dennis Wagelaar
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/EmftvmFactory.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/EmftvmFactory.java
index caee5261..089ded91 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/EmftvmFactory.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/EmftvmFactory.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright (c) 2011-2012 Vrije Universiteit Brussel.
+ * Copyright (c) 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -12,6 +13,7 @@
package org.eclipse.m2m.atl.emftvm;
import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.resource.Resource;
/**
* <!-- begin-user-doc -->
@@ -623,4 +625,22 @@ public interface EmftvmFactory extends EFactory {
*/
Instruction createInstruction(Opcode opcode);
+ /**
+ * Creates a new {@link Model} for the given {@link Resource}, and sets the
+ * {@link Resource}.
+ *
+ * @param resource the {@link Resource} to wrap
+ * @return a new {@link Model}
+ */
+ Model createModel(Resource resource);
+
+ /**
+ * Creates a new {@link Metamodel} for the given {@link Resource}, and sets the
+ * {@link Resource}.
+ *
+ * @param resource the {@link Resource} to wrap
+ * @return a new {@link Metamodel}
+ */
+ Metamodel createMetamodel(Resource resource);
+
} //EmftvmFactory
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/ModelFactory.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/ModelFactory.java
new file mode 100644
index 00000000..579239d6
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/ModelFactory.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2021 Dennis Wagelaar.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * Contributors:
+ * Dennis Wagelaar - initial API and
+ * implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.m2m.atl.emftvm;
+
+import org.eclipse.emf.ecore.resource.Resource;
+
+/**
+ * Interface for {@link Resource}-specific {@link Model} factory objects.
+ *
+ * @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
+ */
+public interface ModelFactory {
+
+ /**
+ * Creates a new {@link Model} for the given {@link Resource}.
+ *
+ * @param resource the {@link Resource} to wrap
+ * @return a new {@link Model}
+ */
+ Model createModel(Resource resource);
+
+ /**
+ * Creates a new {@link Metamodel} for the given {@link Resource}.
+ *
+ * @param resource the {@link Resource} to wrap
+ * @return a new {@link Metamodel}
+ */
+ Metamodel createMetamodel(Resource resource);
+
+}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/EmftvmFactoryImpl.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/EmftvmFactoryImpl.java
index 6a898a00..deeb1704 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/EmftvmFactoryImpl.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/EmftvmFactoryImpl.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright (c) 2011-2012 Vrije Universiteit Brussel.
+ * Copyright (c) 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -20,6 +21,8 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.m2m.atl.common.ATLLogger;
import org.eclipse.m2m.atl.emftvm.Add;
import org.eclipse.m2m.atl.emftvm.Allinst;
import org.eclipse.m2m.atl.emftvm.AllinstIn;
@@ -69,6 +72,7 @@ import org.eclipse.m2m.atl.emftvm.Metamodel;
import org.eclipse.m2m.atl.emftvm.Model;
import org.eclipse.m2m.atl.emftvm.ModelDeclaration;
import org.eclipse.m2m.atl.emftvm.ModelDeclarationTag;
+import org.eclipse.m2m.atl.emftvm.ModelFactory;
import org.eclipse.m2m.atl.emftvm.Module;
import org.eclipse.m2m.atl.emftvm.New;
import org.eclipse.m2m.atl.emftvm.NewS;
@@ -99,8 +103,11 @@ import org.eclipse.m2m.atl.emftvm.util.LazyList;
import org.eclipse.m2m.atl.emftvm.util.LazyOrderedSet;
import org.eclipse.m2m.atl.emftvm.util.LazySet;
import org.eclipse.m2m.atl.emftvm.util.ModuleResolver;
+import org.eclipse.m2m.atl.emftvm.util.PluginExtensionUtil;
import org.eclipse.m2m.atl.emftvm.util.StackFrame;
import org.eclipse.m2m.atl.emftvm.util.TimingData;
+import org.eclipse.m2m.atl.emftvm.util.TypeHashMap;
+import org.eclipse.m2m.atl.emftvm.util.TypeMap;
/**
* <!-- begin-user-doc -->
@@ -110,6 +117,16 @@ import org.eclipse.m2m.atl.emftvm.util.TimingData;
* @generated
*/
public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
+
+ /**
+ * Implementation class name for {@link PluginExtensionUtil}.
+ */
+ private static final String PLUGIN_EXTENSION_UTIL_IMPL = "org.eclipse.m2m.atl.emftvm.util.PluginExtensionUtilImpl";
+
+ protected final ModelFactory defaultModelFactory = new ModelFactoryImpl();
+
+ private TypeMap<Class<?>, ModelFactory> modelFactoryRegistry;
+
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
@@ -129,12 +146,12 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
*/
public static EmftvmFactory init() {
try {
- EmftvmFactory theEmftvmFactory = (EmftvmFactory)EPackage.Registry.INSTANCE.getEFactory(EmftvmPackage.eNS_URI);
+ final EmftvmFactory theEmftvmFactory = (EmftvmFactory)EPackage.Registry.INSTANCE.getEFactory(EmftvmPackage.eNS_URI);
if (theEmftvmFactory != null) {
return theEmftvmFactory;
}
}
- catch (Exception exception) {
+ catch (final Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new EmftvmFactoryImpl();
@@ -147,74 +164,74 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
@Override
- public EObject create(EClass eClass) {
+ public EObject create(final EClass eClass) {
switch (eClass.getClassifierID()) {
- case EmftvmPackage.EXEC_ENV: return createExecEnv();
- case EmftvmPackage.MODEL: return createModel();
- case EmftvmPackage.METAMODEL: return createMetamodel();
- case EmftvmPackage.MODULE: return createModule();
- case EmftvmPackage.MODEL_DECLARATION: return createModelDeclaration();
- case EmftvmPackage.FIELD: return createField();
- case EmftvmPackage.OPERATION: return createOperation();
- case EmftvmPackage.PARAMETER: return createParameter();
- case EmftvmPackage.LINE_NUMBER: return createLineNumber();
- case EmftvmPackage.LOCAL_VARIABLE: return createLocalVariable();
- case EmftvmPackage.RULE: return createRule();
- case EmftvmPackage.INPUT_RULE_ELEMENT: return createInputRuleElement();
- case EmftvmPackage.OUTPUT_RULE_ELEMENT: return createOutputRuleElement();
- case EmftvmPackage.CODE_BLOCK: return createCodeBlock();
- case EmftvmPackage.PUSH: return createPush();
- case EmftvmPackage.PUSHT: return createPusht();
- case EmftvmPackage.PUSHF: return createPushf();
- case EmftvmPackage.POP: return createPop();
- case EmftvmPackage.LOAD: return createLoad();
- case EmftvmPackage.STORE: return createStore();
- case EmftvmPackage.SET: return createSet();
- case EmftvmPackage.GET: return createGet();
- case EmftvmPackage.GET_TRANS: return createGetTrans();
- case EmftvmPackage.SET_STATIC: return createSetStatic();
- case EmftvmPackage.GET_STATIC: return createGetStatic();
- case EmftvmPackage.FINDTYPE: return createFindtype();
- case EmftvmPackage.FINDTYPE_S: return createFindtypeS();
- case EmftvmPackage.NEW: return createNew();
- case EmftvmPackage.NEW_S: return createNewS();
- case EmftvmPackage.DELETE: return createDelete();
- case EmftvmPackage.DUP: return createDup();
- case EmftvmPackage.DUP_X1: return createDupX1();
- case EmftvmPackage.SWAP: return createSwap();
- case EmftvmPackage.SWAP_X1: return createSwapX1();
- case EmftvmPackage.IF: return createIf();
- case EmftvmPackage.IFN: return createIfn();
- case EmftvmPackage.GOTO: return createGoto();
- case EmftvmPackage.ITERATE: return createIterate();
- case EmftvmPackage.ENDITERATE: return createEnditerate();
- case EmftvmPackage.INVOKE: return createInvoke();
- case EmftvmPackage.INVOKE_SUPER: return createInvokeSuper();
- case EmftvmPackage.INVOKE_STATIC: return createInvokeStatic();
- case EmftvmPackage.ALLINST: return createAllinst();
- case EmftvmPackage.ALLINST_IN: return createAllinstIn();
- case EmftvmPackage.ISNULL: return createIsnull();
- case EmftvmPackage.GETENVTYPE: return createGetenvtype();
- case EmftvmPackage.NOT: return createNot();
- case EmftvmPackage.AND: return createAnd();
- case EmftvmPackage.OR: return createOr();
- case EmftvmPackage.XOR: return createXor();
- case EmftvmPackage.IMPLIES: return createImplies();
- case EmftvmPackage.IFTE: return createIfte();
- case EmftvmPackage.RETURN: return createReturn();
- case EmftvmPackage.GETCB: return createGetcb();
- case EmftvmPackage.INVOKE_ALL_CBS: return createInvokeAllCbs();
- case EmftvmPackage.INVOKE_CB: return createInvokeCb();
- case EmftvmPackage.INVOKE_CB_S: return createInvokeCbS();
- case EmftvmPackage.MATCH: return createMatch();
- case EmftvmPackage.MATCH_S: return createMatchS();
- case EmftvmPackage.ADD: return createAdd();
- case EmftvmPackage.REMOVE: return createRemove();
- case EmftvmPackage.INSERT: return createInsert();
- case EmftvmPackage.GET_SUPER: return createGetSuper();
- case EmftvmPackage.GETENV: return createGetenv();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ case EmftvmPackage.EXEC_ENV: return createExecEnv();
+ case EmftvmPackage.MODEL: return createModel();
+ case EmftvmPackage.METAMODEL: return createMetamodel();
+ case EmftvmPackage.MODULE: return createModule();
+ case EmftvmPackage.MODEL_DECLARATION: return createModelDeclaration();
+ case EmftvmPackage.FIELD: return createField();
+ case EmftvmPackage.OPERATION: return createOperation();
+ case EmftvmPackage.PARAMETER: return createParameter();
+ case EmftvmPackage.LINE_NUMBER: return createLineNumber();
+ case EmftvmPackage.LOCAL_VARIABLE: return createLocalVariable();
+ case EmftvmPackage.RULE: return createRule();
+ case EmftvmPackage.INPUT_RULE_ELEMENT: return createInputRuleElement();
+ case EmftvmPackage.OUTPUT_RULE_ELEMENT: return createOutputRuleElement();
+ case EmftvmPackage.CODE_BLOCK: return createCodeBlock();
+ case EmftvmPackage.PUSH: return createPush();
+ case EmftvmPackage.PUSHT: return createPusht();
+ case EmftvmPackage.PUSHF: return createPushf();
+ case EmftvmPackage.POP: return createPop();
+ case EmftvmPackage.LOAD: return createLoad();
+ case EmftvmPackage.STORE: return createStore();
+ case EmftvmPackage.SET: return createSet();
+ case EmftvmPackage.GET: return createGet();
+ case EmftvmPackage.GET_TRANS: return createGetTrans();
+ case EmftvmPackage.SET_STATIC: return createSetStatic();
+ case EmftvmPackage.GET_STATIC: return createGetStatic();
+ case EmftvmPackage.FINDTYPE: return createFindtype();
+ case EmftvmPackage.FINDTYPE_S: return createFindtypeS();
+ case EmftvmPackage.NEW: return createNew();
+ case EmftvmPackage.NEW_S: return createNewS();
+ case EmftvmPackage.DELETE: return createDelete();
+ case EmftvmPackage.DUP: return createDup();
+ case EmftvmPackage.DUP_X1: return createDupX1();
+ case EmftvmPackage.SWAP: return createSwap();
+ case EmftvmPackage.SWAP_X1: return createSwapX1();
+ case EmftvmPackage.IF: return createIf();
+ case EmftvmPackage.IFN: return createIfn();
+ case EmftvmPackage.GOTO: return createGoto();
+ case EmftvmPackage.ITERATE: return createIterate();
+ case EmftvmPackage.ENDITERATE: return createEnditerate();
+ case EmftvmPackage.INVOKE: return createInvoke();
+ case EmftvmPackage.INVOKE_SUPER: return createInvokeSuper();
+ case EmftvmPackage.INVOKE_STATIC: return createInvokeStatic();
+ case EmftvmPackage.ALLINST: return createAllinst();
+ case EmftvmPackage.ALLINST_IN: return createAllinstIn();
+ case EmftvmPackage.ISNULL: return createIsnull();
+ case EmftvmPackage.GETENVTYPE: return createGetenvtype();
+ case EmftvmPackage.NOT: return createNot();
+ case EmftvmPackage.AND: return createAnd();
+ case EmftvmPackage.OR: return createOr();
+ case EmftvmPackage.XOR: return createXor();
+ case EmftvmPackage.IMPLIES: return createImplies();
+ case EmftvmPackage.IFTE: return createIfte();
+ case EmftvmPackage.RETURN: return createReturn();
+ case EmftvmPackage.GETCB: return createGetcb();
+ case EmftvmPackage.INVOKE_ALL_CBS: return createInvokeAllCbs();
+ case EmftvmPackage.INVOKE_CB: return createInvokeCb();
+ case EmftvmPackage.INVOKE_CB_S: return createInvokeCbS();
+ case EmftvmPackage.MATCH: return createMatch();
+ case EmftvmPackage.MATCH_S: return createMatchS();
+ case EmftvmPackage.ADD: return createAdd();
+ case EmftvmPackage.REMOVE: return createRemove();
+ case EmftvmPackage.INSERT: return createInsert();
+ case EmftvmPackage.GET_SUPER: return createGetSuper();
+ case EmftvmPackage.GETENV: return createGetenv();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
@@ -225,52 +242,52 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
@Override
- public Object createFromString(EDataType eDataType, String initialValue) {
+ public Object createFromString(final EDataType eDataType, final String initialValue) {
switch (eDataType.getClassifierID()) {
- case EmftvmPackage.MODEL_DECLARATION_TAG:
- return createModelDeclarationTagFromString(eDataType, initialValue);
- case EmftvmPackage.FEATURE_TAG:
- return createFeatureTagFromString(eDataType, initialValue);
- case EmftvmPackage.OPCODE:
- return createOpcodeFromString(eDataType, initialValue);
- case EmftvmPackage.RULE_MODE:
- return createRuleModeFromString(eDataType, initialValue);
- case EmftvmPackage.CONSTANT_TAG:
- return createConstantTagFromString(eDataType, initialValue);
- case EmftvmPackage.MODULE_RESOLVER:
- return createModuleResolverFromString(eDataType, initialValue);
- case EmftvmPackage.ENUM_LITERAL:
- return createEnumLiteralFromString(eDataType, initialValue);
- case EmftvmPackage.STACK_FRAME:
- return createStackFrameFromString(eDataType, initialValue);
- case EmftvmPackage.METHOD:
- return createMethodFromString(eDataType, initialValue);
- case EmftvmPackage.TIMING_DATA:
- return createTimingDataFromString(eDataType, initialValue);
- case EmftvmPackage.LAZY_COLLECTION:
- return createLazyCollectionFromString(eDataType, initialValue);
- case EmftvmPackage.LAZY_BAG:
- return createLazyBagFromString(eDataType, initialValue);
- case EmftvmPackage.LAZY_LIST:
- return createLazyListFromString(eDataType, initialValue);
- case EmftvmPackage.LAZY_ORDERED_SET:
- return createLazyOrderedSetFromString(eDataType, initialValue);
- case EmftvmPackage.LAZY_SET:
- return createLazySetFromString(eDataType, initialValue);
- case EmftvmPackage.EJAVA_OBJECT_ARRAY:
- return createEJavaObjectArrayFromString(eDataType, initialValue);
- case EmftvmPackage.EOBJECT_ARRAY:
- return createEObjectArrayFromString(eDataType, initialValue);
- case EmftvmPackage.EBOOLEAN_ARRAY:
- return createEBooleanArrayFromString(eDataType, initialValue);
- case EmftvmPackage.EJAVA_SET:
- return createEJavaSetFromString(eDataType, initialValue);
- case EmftvmPackage.EJAVA_ITERABLE:
- return createEJavaIterableFromString(eDataType, initialValue);
- case EmftvmPackage.CLASS_NOT_FOUND_EXCEPTION:
- return createClassNotFoundExceptionFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ case EmftvmPackage.MODEL_DECLARATION_TAG:
+ return createModelDeclarationTagFromString(eDataType, initialValue);
+ case EmftvmPackage.FEATURE_TAG:
+ return createFeatureTagFromString(eDataType, initialValue);
+ case EmftvmPackage.OPCODE:
+ return createOpcodeFromString(eDataType, initialValue);
+ case EmftvmPackage.RULE_MODE:
+ return createRuleModeFromString(eDataType, initialValue);
+ case EmftvmPackage.CONSTANT_TAG:
+ return createConstantTagFromString(eDataType, initialValue);
+ case EmftvmPackage.MODULE_RESOLVER:
+ return createModuleResolverFromString(eDataType, initialValue);
+ case EmftvmPackage.ENUM_LITERAL:
+ return createEnumLiteralFromString(eDataType, initialValue);
+ case EmftvmPackage.STACK_FRAME:
+ return createStackFrameFromString(eDataType, initialValue);
+ case EmftvmPackage.METHOD:
+ return createMethodFromString(eDataType, initialValue);
+ case EmftvmPackage.TIMING_DATA:
+ return createTimingDataFromString(eDataType, initialValue);
+ case EmftvmPackage.LAZY_COLLECTION:
+ return createLazyCollectionFromString(eDataType, initialValue);
+ case EmftvmPackage.LAZY_BAG:
+ return createLazyBagFromString(eDataType, initialValue);
+ case EmftvmPackage.LAZY_LIST:
+ return createLazyListFromString(eDataType, initialValue);
+ case EmftvmPackage.LAZY_ORDERED_SET:
+ return createLazyOrderedSetFromString(eDataType, initialValue);
+ case EmftvmPackage.LAZY_SET:
+ return createLazySetFromString(eDataType, initialValue);
+ case EmftvmPackage.EJAVA_OBJECT_ARRAY:
+ return createEJavaObjectArrayFromString(eDataType, initialValue);
+ case EmftvmPackage.EOBJECT_ARRAY:
+ return createEObjectArrayFromString(eDataType, initialValue);
+ case EmftvmPackage.EBOOLEAN_ARRAY:
+ return createEBooleanArrayFromString(eDataType, initialValue);
+ case EmftvmPackage.EJAVA_SET:
+ return createEJavaSetFromString(eDataType, initialValue);
+ case EmftvmPackage.EJAVA_ITERABLE:
+ return createEJavaIterableFromString(eDataType, initialValue);
+ case EmftvmPackage.CLASS_NOT_FOUND_EXCEPTION:
+ return createClassNotFoundExceptionFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
@@ -281,52 +298,52 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
@Override
- public String convertToString(EDataType eDataType, Object instanceValue) {
+ public String convertToString(final EDataType eDataType, final Object instanceValue) {
switch (eDataType.getClassifierID()) {
- case EmftvmPackage.MODEL_DECLARATION_TAG:
- return convertModelDeclarationTagToString(eDataType, instanceValue);
- case EmftvmPackage.FEATURE_TAG:
- return convertFeatureTagToString(eDataType, instanceValue);
- case EmftvmPackage.OPCODE:
- return convertOpcodeToString(eDataType, instanceValue);
- case EmftvmPackage.RULE_MODE:
- return convertRuleModeToString(eDataType, instanceValue);
- case EmftvmPackage.CONSTANT_TAG:
- return convertConstantTagToString(eDataType, instanceValue);
- case EmftvmPackage.MODULE_RESOLVER:
- return convertModuleResolverToString(eDataType, instanceValue);
- case EmftvmPackage.ENUM_LITERAL:
- return convertEnumLiteralToString(eDataType, instanceValue);
- case EmftvmPackage.STACK_FRAME:
- return convertStackFrameToString(eDataType, instanceValue);
- case EmftvmPackage.METHOD:
- return convertMethodToString(eDataType, instanceValue);
- case EmftvmPackage.TIMING_DATA:
- return convertTimingDataToString(eDataType, instanceValue);
- case EmftvmPackage.LAZY_COLLECTION:
- return convertLazyCollectionToString(eDataType, instanceValue);
- case EmftvmPackage.LAZY_BAG:
- return convertLazyBagToString(eDataType, instanceValue);
- case EmftvmPackage.LAZY_LIST:
- return convertLazyListToString(eDataType, instanceValue);
- case EmftvmPackage.LAZY_ORDERED_SET:
- return convertLazyOrderedSetToString(eDataType, instanceValue);
- case EmftvmPackage.LAZY_SET:
- return convertLazySetToString(eDataType, instanceValue);
- case EmftvmPackage.EJAVA_OBJECT_ARRAY:
- return convertEJavaObjectArrayToString(eDataType, instanceValue);
- case EmftvmPackage.EOBJECT_ARRAY:
- return convertEObjectArrayToString(eDataType, instanceValue);
- case EmftvmPackage.EBOOLEAN_ARRAY:
- return convertEBooleanArrayToString(eDataType, instanceValue);
- case EmftvmPackage.EJAVA_SET:
- return convertEJavaSetToString(eDataType, instanceValue);
- case EmftvmPackage.EJAVA_ITERABLE:
- return convertEJavaIterableToString(eDataType, instanceValue);
- case EmftvmPackage.CLASS_NOT_FOUND_EXCEPTION:
- return convertClassNotFoundExceptionToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ case EmftvmPackage.MODEL_DECLARATION_TAG:
+ return convertModelDeclarationTagToString(eDataType, instanceValue);
+ case EmftvmPackage.FEATURE_TAG:
+ return convertFeatureTagToString(eDataType, instanceValue);
+ case EmftvmPackage.OPCODE:
+ return convertOpcodeToString(eDataType, instanceValue);
+ case EmftvmPackage.RULE_MODE:
+ return convertRuleModeToString(eDataType, instanceValue);
+ case EmftvmPackage.CONSTANT_TAG:
+ return convertConstantTagToString(eDataType, instanceValue);
+ case EmftvmPackage.MODULE_RESOLVER:
+ return convertModuleResolverToString(eDataType, instanceValue);
+ case EmftvmPackage.ENUM_LITERAL:
+ return convertEnumLiteralToString(eDataType, instanceValue);
+ case EmftvmPackage.STACK_FRAME:
+ return convertStackFrameToString(eDataType, instanceValue);
+ case EmftvmPackage.METHOD:
+ return convertMethodToString(eDataType, instanceValue);
+ case EmftvmPackage.TIMING_DATA:
+ return convertTimingDataToString(eDataType, instanceValue);
+ case EmftvmPackage.LAZY_COLLECTION:
+ return convertLazyCollectionToString(eDataType, instanceValue);
+ case EmftvmPackage.LAZY_BAG:
+ return convertLazyBagToString(eDataType, instanceValue);
+ case EmftvmPackage.LAZY_LIST:
+ return convertLazyListToString(eDataType, instanceValue);
+ case EmftvmPackage.LAZY_ORDERED_SET:
+ return convertLazyOrderedSetToString(eDataType, instanceValue);
+ case EmftvmPackage.LAZY_SET:
+ return convertLazySetToString(eDataType, instanceValue);
+ case EmftvmPackage.EJAVA_OBJECT_ARRAY:
+ return convertEJavaObjectArrayToString(eDataType, instanceValue);
+ case EmftvmPackage.EOBJECT_ARRAY:
+ return convertEObjectArrayToString(eDataType, instanceValue);
+ case EmftvmPackage.EBOOLEAN_ARRAY:
+ return convertEBooleanArrayToString(eDataType, instanceValue);
+ case EmftvmPackage.EJAVA_SET:
+ return convertEJavaSetToString(eDataType, instanceValue);
+ case EmftvmPackage.EJAVA_ITERABLE:
+ return convertEJavaIterableToString(eDataType, instanceValue);
+ case EmftvmPackage.CLASS_NOT_FOUND_EXCEPTION:
+ return convertClassNotFoundExceptionToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
@@ -337,7 +354,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Module createModule() {
- ModuleImpl module = new ModuleImpl();
+ final ModuleImpl module = new ModuleImpl();
return module;
}
@@ -348,7 +365,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public ModelDeclaration createModelDeclaration() {
- ModelDeclarationImpl modelDeclaration = new ModelDeclarationImpl();
+ final ModelDeclarationImpl modelDeclaration = new ModelDeclarationImpl();
return modelDeclaration;
}
@@ -359,7 +376,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Field createField() {
- FieldImpl field = new FieldImpl();
+ final FieldImpl field = new FieldImpl();
return field;
}
@@ -370,7 +387,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Operation createOperation() {
- OperationImpl operation = new OperationImpl();
+ final OperationImpl operation = new OperationImpl();
return operation;
}
@@ -381,7 +398,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Parameter createParameter() {
- ParameterImpl parameter = new ParameterImpl();
+ final ParameterImpl parameter = new ParameterImpl();
return parameter;
}
@@ -392,7 +409,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public LineNumber createLineNumber() {
- LineNumberImpl lineNumber = new LineNumberImpl();
+ final LineNumberImpl lineNumber = new LineNumberImpl();
return lineNumber;
}
@@ -403,7 +420,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public LocalVariable createLocalVariable() {
- LocalVariableImpl localVariable = new LocalVariableImpl();
+ final LocalVariableImpl localVariable = new LocalVariableImpl();
return localVariable;
}
@@ -414,7 +431,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Rule createRule() {
- RuleImpl rule = new RuleImpl();
+ final RuleImpl rule = new RuleImpl();
return rule;
}
@@ -425,7 +442,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public InputRuleElement createInputRuleElement() {
- InputRuleElementImpl inputRuleElement = new InputRuleElementImpl();
+ final InputRuleElementImpl inputRuleElement = new InputRuleElementImpl();
return inputRuleElement;
}
@@ -436,7 +453,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public OutputRuleElement createOutputRuleElement() {
- OutputRuleElementImpl outputRuleElement = new OutputRuleElementImpl();
+ final OutputRuleElementImpl outputRuleElement = new OutputRuleElementImpl();
return outputRuleElement;
}
@@ -447,7 +464,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public CodeBlock createCodeBlock() {
- CodeBlockImpl codeBlock = new CodeBlockImpl();
+ final CodeBlockImpl codeBlock = new CodeBlockImpl();
return codeBlock;
}
@@ -458,7 +475,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Push createPush() {
- PushImpl push = new PushImpl();
+ final PushImpl push = new PushImpl();
return push;
}
@@ -469,7 +486,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Pusht createPusht() {
- PushtImpl pusht = new PushtImpl();
+ final PushtImpl pusht = new PushtImpl();
return pusht;
}
@@ -480,7 +497,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Pushf createPushf() {
- PushfImpl pushf = new PushfImpl();
+ final PushfImpl pushf = new PushfImpl();
return pushf;
}
@@ -491,7 +508,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Pop createPop() {
- PopImpl pop = new PopImpl();
+ final PopImpl pop = new PopImpl();
return pop;
}
@@ -502,7 +519,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Load createLoad() {
- LoadImpl load = new LoadImpl();
+ final LoadImpl load = new LoadImpl();
return load;
}
@@ -513,7 +530,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Store createStore() {
- StoreImpl store = new StoreImpl();
+ final StoreImpl store = new StoreImpl();
return store;
}
@@ -524,7 +541,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Set createSet() {
- SetImpl set = new SetImpl();
+ final SetImpl set = new SetImpl();
return set;
}
@@ -535,7 +552,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Get createGet() {
- GetImpl get = new GetImpl();
+ final GetImpl get = new GetImpl();
return get;
}
@@ -546,7 +563,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public GetTrans createGetTrans() {
- GetTransImpl getTrans = new GetTransImpl();
+ final GetTransImpl getTrans = new GetTransImpl();
return getTrans;
}
@@ -557,7 +574,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public SetStatic createSetStatic() {
- SetStaticImpl setStatic = new SetStaticImpl();
+ final SetStaticImpl setStatic = new SetStaticImpl();
return setStatic;
}
@@ -568,7 +585,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public GetStatic createGetStatic() {
- GetStaticImpl getStatic = new GetStaticImpl();
+ final GetStaticImpl getStatic = new GetStaticImpl();
return getStatic;
}
@@ -579,7 +596,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Findtype createFindtype() {
- FindtypeImpl findtype = new FindtypeImpl();
+ final FindtypeImpl findtype = new FindtypeImpl();
return findtype;
}
@@ -590,7 +607,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public FindtypeS createFindtypeS() {
- FindtypeSImpl findtypeS = new FindtypeSImpl();
+ final FindtypeSImpl findtypeS = new FindtypeSImpl();
return findtypeS;
}
@@ -601,7 +618,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public New createNew() {
- NewImpl new_ = new NewImpl();
+ final NewImpl new_ = new NewImpl();
return new_;
}
@@ -612,7 +629,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public NewS createNewS() {
- NewSImpl newS = new NewSImpl();
+ final NewSImpl newS = new NewSImpl();
return newS;
}
@@ -623,7 +640,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Delete createDelete() {
- DeleteImpl delete = new DeleteImpl();
+ final DeleteImpl delete = new DeleteImpl();
return delete;
}
@@ -634,7 +651,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Dup createDup() {
- DupImpl dup = new DupImpl();
+ final DupImpl dup = new DupImpl();
return dup;
}
@@ -645,7 +662,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public DupX1 createDupX1() {
- DupX1Impl dupX1 = new DupX1Impl();
+ final DupX1Impl dupX1 = new DupX1Impl();
return dupX1;
}
@@ -656,7 +673,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Swap createSwap() {
- SwapImpl swap = new SwapImpl();
+ final SwapImpl swap = new SwapImpl();
return swap;
}
@@ -667,7 +684,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public SwapX1 createSwapX1() {
- SwapX1Impl swapX1 = new SwapX1Impl();
+ final SwapX1Impl swapX1 = new SwapX1Impl();
return swapX1;
}
@@ -678,7 +695,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public If createIf() {
- IfImpl if_ = new IfImpl();
+ final IfImpl if_ = new IfImpl();
return if_;
}
@@ -689,7 +706,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Ifn createIfn() {
- IfnImpl ifn = new IfnImpl();
+ final IfnImpl ifn = new IfnImpl();
return ifn;
}
@@ -700,7 +717,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Goto createGoto() {
- GotoImpl goto_ = new GotoImpl();
+ final GotoImpl goto_ = new GotoImpl();
return goto_;
}
@@ -711,7 +728,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Iterate createIterate() {
- IterateImpl iterate = new IterateImpl();
+ final IterateImpl iterate = new IterateImpl();
return iterate;
}
@@ -722,7 +739,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Enditerate createEnditerate() {
- EnditerateImpl enditerate = new EnditerateImpl();
+ final EnditerateImpl enditerate = new EnditerateImpl();
return enditerate;
}
@@ -733,7 +750,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Invoke createInvoke() {
- InvokeImpl invoke = new InvokeImpl();
+ final InvokeImpl invoke = new InvokeImpl();
return invoke;
}
@@ -744,7 +761,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public InvokeSuper createInvokeSuper() {
- InvokeSuperImpl invokeSuper = new InvokeSuperImpl();
+ final InvokeSuperImpl invokeSuper = new InvokeSuperImpl();
return invokeSuper;
}
@@ -755,7 +772,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public InvokeStatic createInvokeStatic() {
- InvokeStaticImpl invokeStatic = new InvokeStaticImpl();
+ final InvokeStaticImpl invokeStatic = new InvokeStaticImpl();
return invokeStatic;
}
@@ -766,7 +783,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Allinst createAllinst() {
- AllinstImpl allinst = new AllinstImpl();
+ final AllinstImpl allinst = new AllinstImpl();
return allinst;
}
@@ -777,7 +794,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public AllinstIn createAllinstIn() {
- AllinstInImpl allinstIn = new AllinstInImpl();
+ final AllinstInImpl allinstIn = new AllinstInImpl();
return allinstIn;
}
@@ -788,7 +805,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Match createMatch() {
- MatchImpl match = new MatchImpl();
+ final MatchImpl match = new MatchImpl();
return match;
}
@@ -799,7 +816,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public MatchS createMatchS() {
- MatchSImpl matchS = new MatchSImpl();
+ final MatchSImpl matchS = new MatchSImpl();
return matchS;
}
@@ -810,7 +827,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Add createAdd() {
- AddImpl add = new AddImpl();
+ final AddImpl add = new AddImpl();
return add;
}
@@ -821,7 +838,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Remove createRemove() {
- RemoveImpl remove = new RemoveImpl();
+ final RemoveImpl remove = new RemoveImpl();
return remove;
}
@@ -832,7 +849,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Insert createInsert() {
- InsertImpl insert = new InsertImpl();
+ final InsertImpl insert = new InsertImpl();
return insert;
}
@@ -842,7 +859,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public GetSuper createGetSuper() {
- GetSuperImpl getSuper = new GetSuperImpl();
+ final GetSuperImpl getSuper = new GetSuperImpl();
return getSuper;
}
@@ -852,7 +869,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Getenv createGetenv() {
- GetenvImpl getenv = new GetenvImpl();
+ final GetenvImpl getenv = new GetenvImpl();
return getenv;
}
@@ -863,7 +880,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Return createReturn() {
- ReturnImpl return_ = new ReturnImpl();
+ final ReturnImpl return_ = new ReturnImpl();
return return_;
}
@@ -874,7 +891,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Getcb createGetcb() {
- GetcbImpl getcb = new GetcbImpl();
+ final GetcbImpl getcb = new GetcbImpl();
return getcb;
}
@@ -885,7 +902,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public InvokeAllCbs createInvokeAllCbs() {
- InvokeAllCbsImpl invokeAllCbs = new InvokeAllCbsImpl();
+ final InvokeAllCbsImpl invokeAllCbs = new InvokeAllCbsImpl();
return invokeAllCbs;
}
@@ -896,7 +913,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public InvokeCb createInvokeCb() {
- InvokeCbImpl invokeCb = new InvokeCbImpl();
+ final InvokeCbImpl invokeCb = new InvokeCbImpl();
return invokeCb;
}
@@ -907,7 +924,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public InvokeCbS createInvokeCbS() {
- InvokeCbSImpl invokeCbS = new InvokeCbSImpl();
+ final InvokeCbSImpl invokeCbS = new InvokeCbSImpl();
return invokeCbS;
}
@@ -917,8 +934,8 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public ModelDeclarationTag createModelDeclarationTagFromString(EDataType eDataType, String initialValue) {
- ModelDeclarationTag result = ModelDeclarationTag.get(initialValue);
+ public ModelDeclarationTag createModelDeclarationTagFromString(final EDataType eDataType, final String initialValue) {
+ final ModelDeclarationTag result = ModelDeclarationTag.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
}
@@ -929,7 +946,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertModelDeclarationTagToString(EDataType eDataType, Object instanceValue) {
+ public String convertModelDeclarationTagToString(final EDataType eDataType, final Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
@@ -940,7 +957,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Not createNot() {
- NotImpl not = new NotImpl();
+ final NotImpl not = new NotImpl();
return not;
}
@@ -951,7 +968,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public And createAnd() {
- AndImpl and = new AndImpl();
+ final AndImpl and = new AndImpl();
return and;
}
@@ -962,7 +979,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Or createOr() {
- OrImpl or = new OrImpl();
+ final OrImpl or = new OrImpl();
return or;
}
@@ -973,7 +990,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Xor createXor() {
- XorImpl xor = new XorImpl();
+ final XorImpl xor = new XorImpl();
return xor;
}
@@ -984,7 +1001,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Implies createImplies() {
- ImpliesImpl implies = new ImpliesImpl();
+ final ImpliesImpl implies = new ImpliesImpl();
return implies;
}
@@ -995,7 +1012,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Ifte createIfte() {
- IfteImpl ifte = new IfteImpl();
+ final IfteImpl ifte = new IfteImpl();
return ifte;
}
@@ -1006,7 +1023,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Isnull createIsnull() {
- IsnullImpl isnull = new IsnullImpl();
+ final IsnullImpl isnull = new IsnullImpl();
return isnull;
}
@@ -1017,7 +1034,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Getenvtype createGetenvtype() {
- GetenvtypeImpl getenvtype = new GetenvtypeImpl();
+ final GetenvtypeImpl getenvtype = new GetenvtypeImpl();
return getenvtype;
}
@@ -1027,8 +1044,8 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public FeatureTag createFeatureTagFromString(EDataType eDataType, String initialValue) {
- FeatureTag result = FeatureTag.get(initialValue);
+ public FeatureTag createFeatureTagFromString(final EDataType eDataType, final String initialValue) {
+ final FeatureTag result = FeatureTag.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
}
@@ -1039,7 +1056,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertFeatureTagToString(EDataType eDataType, Object instanceValue) {
+ public String convertFeatureTagToString(final EDataType eDataType, final Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
@@ -1050,7 +1067,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public ExecEnv createExecEnv() {
- ExecEnvImpl execEnv = new ExecEnvImpl();
+ final ExecEnvImpl execEnv = new ExecEnvImpl();
return execEnv;
}
@@ -1061,7 +1078,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Model createModel() {
- ModelImpl model = new ModelImpl();
+ final ModelImpl model = new ModelImpl();
return model;
}
@@ -1072,7 +1089,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* @generated
*/
public Metamodel createMetamodel() {
- MetamodelImpl metamodel = new MetamodelImpl();
+ final MetamodelImpl metamodel = new MetamodelImpl();
return metamodel;
}
@@ -1082,8 +1099,8 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public Opcode createOpcodeFromString(EDataType eDataType, String initialValue) {
- Opcode result = Opcode.get(initialValue);
+ public Opcode createOpcodeFromString(final EDataType eDataType, final String initialValue) {
+ final Opcode result = Opcode.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
}
@@ -1094,7 +1111,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertOpcodeToString(EDataType eDataType, Object instanceValue) {
+ public String convertOpcodeToString(final EDataType eDataType, final Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
@@ -1104,8 +1121,8 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public RuleMode createRuleModeFromString(EDataType eDataType, String initialValue) {
- RuleMode result = RuleMode.get(initialValue);
+ public RuleMode createRuleModeFromString(final EDataType eDataType, final String initialValue) {
+ final RuleMode result = RuleMode.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
}
@@ -1116,7 +1133,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertRuleModeToString(EDataType eDataType, Object instanceValue) {
+ public String convertRuleModeToString(final EDataType eDataType, final Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
@@ -1126,8 +1143,8 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public ConstantTag createConstantTagFromString(EDataType eDataType, String initialValue) {
- ConstantTag result = ConstantTag.get(initialValue);
+ public ConstantTag createConstantTagFromString(final EDataType eDataType, final String initialValue) {
+ final ConstantTag result = ConstantTag.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
}
@@ -1138,7 +1155,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertConstantTagToString(EDataType eDataType, Object instanceValue) {
+ public String convertConstantTagToString(final EDataType eDataType, final Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
@@ -1148,7 +1165,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public StackFrame createStackFrameFromString(EDataType eDataType, String initialValue) {
+ public StackFrame createStackFrameFromString(final EDataType eDataType, final String initialValue) {
return (StackFrame)super.createFromString(eDataType, initialValue);
}
@@ -1158,7 +1175,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertStackFrameToString(EDataType eDataType, Object instanceValue) {
+ public String convertStackFrameToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(eDataType, instanceValue);
}
@@ -1168,7 +1185,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public Method createMethodFromString(EDataType eDataType, String initialValue) {
+ public Method createMethodFromString(final EDataType eDataType, final String initialValue) {
return (Method)super.createFromString(eDataType, initialValue);
}
@@ -1178,7 +1195,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertMethodToString(EDataType eDataType, Object instanceValue) {
+ public String convertMethodToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(eDataType, instanceValue);
}
@@ -1188,7 +1205,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public TimingData createTimingDataFromString(EDataType eDataType, String initialValue) {
+ public TimingData createTimingDataFromString(final EDataType eDataType, final String initialValue) {
return (TimingData)super.createFromString(eDataType, initialValue);
}
@@ -1198,7 +1215,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertTimingDataToString(EDataType eDataType, Object instanceValue) {
+ public String convertTimingDataToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(eDataType, instanceValue);
}
@@ -1208,7 +1225,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public LazyCollection<?> createLazyCollectionFromString(EDataType eDataType, String initialValue) {
+ public LazyCollection<?> createLazyCollectionFromString(final EDataType eDataType, final String initialValue) {
return (LazyCollection<?>)super.createFromString(initialValue);
}
@@ -1218,7 +1235,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertLazyCollectionToString(EDataType eDataType, Object instanceValue) {
+ public String convertLazyCollectionToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(instanceValue);
}
@@ -1228,7 +1245,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public LazyBag<?> createLazyBagFromString(EDataType eDataType, String initialValue) {
+ public LazyBag<?> createLazyBagFromString(final EDataType eDataType, final String initialValue) {
return (LazyBag<?>)super.createFromString(initialValue);
}
@@ -1238,7 +1255,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertLazyBagToString(EDataType eDataType, Object instanceValue) {
+ public String convertLazyBagToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(instanceValue);
}
@@ -1248,7 +1265,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public LazyList<?> createLazyListFromString(EDataType eDataType, String initialValue) {
+ public LazyList<?> createLazyListFromString(final EDataType eDataType, final String initialValue) {
return (LazyList<?>)super.createFromString(initialValue);
}
@@ -1258,7 +1275,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertLazyListToString(EDataType eDataType, Object instanceValue) {
+ public String convertLazyListToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(instanceValue);
}
@@ -1268,7 +1285,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public LazyOrderedSet<?> createLazyOrderedSetFromString(EDataType eDataType, String initialValue) {
+ public LazyOrderedSet<?> createLazyOrderedSetFromString(final EDataType eDataType, final String initialValue) {
return (LazyOrderedSet<?>)super.createFromString(initialValue);
}
@@ -1278,7 +1295,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertLazyOrderedSetToString(EDataType eDataType, Object instanceValue) {
+ public String convertLazyOrderedSetToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(instanceValue);
}
@@ -1288,7 +1305,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public LazySet<?> createLazySetFromString(EDataType eDataType, String initialValue) {
+ public LazySet<?> createLazySetFromString(final EDataType eDataType, final String initialValue) {
return (LazySet<?>)super.createFromString(initialValue);
}
@@ -1298,7 +1315,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertLazySetToString(EDataType eDataType, Object instanceValue) {
+ public String convertLazySetToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(instanceValue);
}
@@ -1307,7 +1324,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public Object[] createEJavaObjectArrayFromString(EDataType eDataType, String initialValue) {
+ public Object[] createEJavaObjectArrayFromString(final EDataType eDataType, final String initialValue) {
return (Object[])super.createFromString(initialValue);
}
@@ -1316,7 +1333,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertEJavaObjectArrayToString(EDataType eDataType, Object instanceValue) {
+ public String convertEJavaObjectArrayToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(instanceValue);
}
@@ -1325,7 +1342,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public EObject[] createEObjectArrayFromString(EDataType eDataType, String initialValue) {
+ public EObject[] createEObjectArrayFromString(final EDataType eDataType, final String initialValue) {
return (EObject[])super.createFromString(initialValue);
}
@@ -1334,7 +1351,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertEObjectArrayToString(EDataType eDataType, Object instanceValue) {
+ public String convertEObjectArrayToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(instanceValue);
}
@@ -1343,7 +1360,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public boolean[] createEBooleanArrayFromString(EDataType eDataType, String initialValue) {
+ public boolean[] createEBooleanArrayFromString(final EDataType eDataType, final String initialValue) {
return (boolean[])super.createFromString(initialValue);
}
@@ -1352,7 +1369,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertEBooleanArrayToString(EDataType eDataType, Object instanceValue) {
+ public String convertEBooleanArrayToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(instanceValue);
}
@@ -1361,7 +1378,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public java.util.Set<?> createEJavaSetFromString(EDataType eDataType, String initialValue) {
+ public java.util.Set<?> createEJavaSetFromString(final EDataType eDataType, final String initialValue) {
return (java.util.Set<?>)super.createFromString(initialValue);
}
@@ -1370,7 +1387,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertEJavaSetToString(EDataType eDataType, Object instanceValue) {
+ public String convertEJavaSetToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(instanceValue);
}
@@ -1379,7 +1396,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public Iterable<?> createEJavaIterableFromString(EDataType eDataType, String initialValue) {
+ public Iterable<?> createEJavaIterableFromString(final EDataType eDataType, final String initialValue) {
return (Iterable<?>)super.createFromString(initialValue);
}
@@ -1388,7 +1405,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertEJavaIterableToString(EDataType eDataType, Object instanceValue) {
+ public String convertEJavaIterableToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(instanceValue);
}
@@ -1397,7 +1414,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public ClassNotFoundException createClassNotFoundExceptionFromString(EDataType eDataType, String initialValue) {
+ public ClassNotFoundException createClassNotFoundExceptionFromString(final EDataType eDataType, final String initialValue) {
return (ClassNotFoundException)super.createFromString(eDataType, initialValue);
}
@@ -1406,7 +1423,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertClassNotFoundExceptionToString(EDataType eDataType, Object instanceValue) {
+ public String convertClassNotFoundExceptionToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(eDataType, instanceValue);
}
@@ -1416,7 +1433,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public ModuleResolver createModuleResolverFromString(EDataType eDataType, String initialValue) {
+ public ModuleResolver createModuleResolverFromString(final EDataType eDataType, final String initialValue) {
return (ModuleResolver)super.createFromString(eDataType, initialValue);
}
@@ -1426,7 +1443,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertModuleResolverToString(EDataType eDataType, Object instanceValue) {
+ public String convertModuleResolverToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(eDataType, instanceValue);
}
@@ -1436,7 +1453,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public EnumLiteral createEnumLiteralFromString(EDataType eDataType, String initialValue) {
+ public EnumLiteral createEnumLiteralFromString(final EDataType eDataType, final String initialValue) {
return (EnumLiteral)super.createFromString(eDataType, initialValue);
}
@@ -1446,7 +1463,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
* <!-- end-user-doc -->
* @generated
*/
- public String convertEnumLiteralToString(EDataType eDataType, Object instanceValue) {
+ public String convertEnumLiteralToString(final EDataType eDataType, final Object instanceValue) {
return super.convertToString(eDataType, instanceValue);
}
@@ -1475,7 +1492,7 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
/**
* {@inheritDoc}
*/
- public Instruction createInstruction(Opcode opcode) {
+ public Instruction createInstruction(final Opcode opcode) {
switch (opcode) {
case PUSH: return createPush();
case PUSHT: return createPusht();
@@ -1532,4 +1549,55 @@ public class EmftvmFactoryImpl extends EFactoryImpl implements EmftvmFactory {
}
}
+ /**
+ * {@inheritDoc}
+ */
+ public Model createModel(final Resource resource) {
+ final TypeMap<Class<?>, ModelFactory> modelFactoryRegistry = getModelFactoryRegistry();
+ final Object key = modelFactoryRegistry.findKey(resource.getClass());
+ if (key != null) {
+ return modelFactoryRegistry.get(key).createModel(resource);
+ }
+ return defaultModelFactory.createModel(resource);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Metamodel createMetamodel(final Resource resource) {
+ final TypeMap<Class<?>, ModelFactory> modelFactoryRegistry = getModelFactoryRegistry();
+ final Object key = modelFactoryRegistry.findKey(resource.getClass());
+ if (key != null) {
+ return modelFactoryRegistry.get(key).createMetamodel(resource);
+ }
+ return defaultModelFactory.createMetamodel(resource);
+ }
+
+ /**
+ * @return the modelFactoryRegistry
+ */
+ protected TypeMap<Class<?>, ModelFactory> getModelFactoryRegistry() {
+ if (modelFactoryRegistry == null) {
+ modelFactoryRegistry = createModelFactoryRegistry();
+ }
+ return modelFactoryRegistry;
+ }
+
+ private TypeMap<Class<?>, ModelFactory> createModelFactoryRegistry() {
+ PluginExtensionUtil peUtil;
+ try {
+ peUtil = (PluginExtensionUtil) Class.forName(PLUGIN_EXTENSION_UTIL_IMPL).newInstance();
+ return peUtil.createModelFactoryRegistry();
+ } catch (final InstantiationException e) {
+ ATLLogger.fine(e.getMessage());
+ } catch (final IllegalAccessException e) {
+ ATLLogger.fine(e.getMessage());
+ } catch (final ClassNotFoundException e) {
+ ATLLogger.fine(e.getMessage());
+ } catch (final NoClassDefFoundError e) {
+ ATLLogger.fine(e.getMessage());
+ }
+ return new TypeHashMap<Class<?>, ModelFactory>();
+ }
+
} //EmftvmFactoryImpl
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ExecEnvImpl.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ExecEnvImpl.java
index c5bba258..594c1af3 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ExecEnvImpl.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ExecEnvImpl.java
@@ -117,7 +117,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
* @author Dennis Wagelaar <dennis.wagelaar@vub.ac.be>
*/
abstract class QueueEntry {
-
+
/**
* The stack frame context in which to perform the queued operation.
*/
@@ -155,9 +155,9 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
* Performs the queued operation.
*/
protected abstract void perform();
-
+
}
-
+
/**
* Hold data for element deletion.
* @author <a href="mailto:dennis.wagelaar@vub.ac.be">Dennis Wagelaar</a>
@@ -181,7 +181,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
/**
* {@inheritDoc}
- *
+ *
* @throws UnsupportedOperationException
*/
@Override
@@ -191,7 +191,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
/**
* {@inheritDoc}
- *
+ *
* Performs the actual deletion of the element from its model.
*/
@Override
@@ -208,7 +208,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
/**
* Performs the queued operation for the given <code>ref</code>.
- *
+ *
* @param o
* the object for which to delete from <code>ref</code>
* @param ref
@@ -230,7 +230,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
}
}
-
+
/**
* Holds data for a queued remap() operation.
* @author <a href="dwagelaar@gmail.com">Dennis Wagelaar</a>
@@ -249,7 +249,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
/**
* Creates a new {@link RemapEntry}.
- *
+ *
* @param source
* the source element to remap
* @param target
@@ -265,7 +265,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
/**
* {@inheritDoc}
- *
+ *
* @throws UnsupportedOperationException
*/
@Override
@@ -275,7 +275,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
/**
* Performs the queued operation for the given <code>ref</code>.
- *
+ *
* @param o
* the object for which to remap <code>ref</code>
* @param ref
@@ -297,7 +297,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
/**
* Performs the queued operation for the given <code>ref</code> and <code>index</code>.
- *
+ *
* @param o
* the object for which to remap <code>ref</code>
* @param ref
@@ -447,7 +447,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
/**
* The internal value of the '{@link #getMetaModels() <em>Meta Models</em>}' attribute.
*/
- protected final Map<String, Metamodel> internalMetaModels =
+ protected final Map<String, Metamodel> internalMetaModels =
Collections.synchronizedMap(new HashMap<String, Metamodel>());
/**
@@ -479,7 +479,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
* Intended for keeping track of cyclic imports.
*/
protected final Set<String> loadedModules = new HashSet<String>();
-
+
/**
* The chain of '<code>main()</code>' operations to be executed after the automatic rules.
*/
@@ -491,7 +491,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
protected final EList<Operation> initChain = new BasicEList<Operation>();
/**
- * Field storage and lookup.
+ * Field storage and lookup.
*/
protected final FieldContainer fieldContainer = new FieldContainer();
@@ -501,8 +501,8 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
* eventually pointing to an {@link Operation}.
* Example: for argcount = 2: (name -> (2 -> (context -> (arg1 -> (arg2 -> op)))))
*/
- protected final Map<String, Map<Integer, TypeMap<Object, Object>>> operations =
- new HashMap<String, Map<Integer,TypeMap<Object,Object>>>();
+ protected final Map<String, Map<Integer, TypeMap<Object, Object>>> operations =
+ new HashMap<String, Map<Integer,TypeMap<Object,Object>>>();
/**
* Lookup table for static operations: (name -> (argcount -> (context -> ?)))
@@ -510,8 +510,8 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
* eventually pointing to an {@link Operation}.
* Example: for argcount = 2: (name -> (2 -> (context -> (arg1 -> (arg2 -> op)))))
*/
- protected final Map<String, Map<Integer, TypeMap<Object, Object>>> staticOperations =
- new HashMap<String, Map<Integer,TypeMap<Object,Object>>>();
+ protected final Map<String, Map<Integer, TypeMap<Object, Object>>> staticOperations =
+ new HashMap<String, Map<Integer,TypeMap<Object,Object>>>();
/**
* Lookup table for rules: (name -> rule).
@@ -579,7 +579,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
* queue entry per source value to remap is supported.
*/
protected final Map<EObject, RemapEntry> remapQueue = new HashMap<EObject, RemapEntry>();
-
+
/**
* Code block stack level validator.
*/
@@ -631,7 +631,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
* @param type field type model and name
* @param initialiser field initialiser codeblock
*/
- private void createField(final String name, final boolean isStatic,
+ private void createField(final String name, final boolean isStatic,
final String[] context, final String[] type, final CodeBlock initialiser) {
final Field f = EMFTVMUtil.createField(name, isStatic, context, type, initialiser);
registerFeature(f);
@@ -1221,7 +1221,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
public Module loadModule(final ModuleResolver resolver, final String name) {
return loadModule(resolver, name, true);
}
-
+
/**
* <!-- begin-user-doc. -->
* {@inheritDoc}
@@ -1268,7 +1268,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
return module;
} catch (final Exception e) {
throw new VMException(null, String.format(
- "Error during module loading: %s",
+ "Error during module loading: %s",
e.getMessage()), e);
}
}
@@ -1283,8 +1283,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
if (diag.getSeverity() != Diagnostic.OK) {
return diag;
}
- final Model mmodel = EmftvmFactory.eINSTANCE.createModel();
- mmodel.setResource(module.eResource());
+ final Model mmodel = EmftvmFactory.eINSTANCE.createModel(module.eResource());
for (final EObject eObject : mmodel.allInstancesOf(EmftvmPackage.eINSTANCE.getCodeBlock())) {
final CodeBlock cb = (CodeBlock) eObject;
if (!cbStackValidator.validate(cb)) {
@@ -1436,8 +1435,8 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
* @return <code>true</code> iff the types of <pre>first</pre> are more specific than the types of <pre>second</pre>
*/
private static boolean isMoreSpecific(
- final EList<Parameter> first,
- final EList<Parameter> second,
+ final EList<Parameter> first,
+ final EList<Parameter> second,
final int index) {
assert first.size() == second.size();
final EClassifier f = first.get(index).getEType();
@@ -1470,7 +1469,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
* @return <code>true</code> iff the types of <pre>first</pre> are more specific than the types of <pre>second</pre>
*/
private static boolean isMoreSpecific(
- final Operation first,
+ final Operation first,
final Operation second) {
final EClassifier f = first.getEContext();
final EClassifier s = second.getEContext();
@@ -1506,7 +1505,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
final Rule oldRule = rules.get(rName);
if (r.getMode() != oldRule.getMode()) {
throw new IllegalArgumentException(String.format(
- "Rule %s with mode %s cannot redefine existing rule with mode %s",
+ "Rule %s with mode %s cannot redefine existing rule with mode %s",
rName, r.getMode(), oldRule.getMode()));
}
}
@@ -1559,7 +1558,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
//check rule type consistency
if (superRule.getMode() != rule.getMode()) {
throw new IllegalArgumentException(String.format(
- "Rule %s with mode %s cannot inherit from super-rule %s with mode %s",
+ "Rule %s with mode %s cannot inherit from super-rule %s with mode %s",
rule.getName(), rule.getMode(), superRule.getName(), superRule.getMode()));
}
//check type consistency of rule element declarations
@@ -1570,10 +1569,10 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
throw new IllegalArgumentException(String.format(
"Output element %s of type %s in rule %s is not compatible with element %s of type %s in super-rule %s",
re.getName(),
- EMFTVMUtil.toPrettyString(re.getEType(), this),
+ EMFTVMUtil.toPrettyString(re.getEType(), this),
rule.getName(),
sre.getName(),
- EMFTVMUtil.toPrettyString(sre.getEType(), this),
+ EMFTVMUtil.toPrettyString(sre.getEType(), this),
superRule.getName()));
}
}
@@ -1651,7 +1650,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
// There are operations with the given name
final int argCount = parameterTypes.length;
final TypeMap<Object, Object> ctxMap = argcountOpsMap.get(argCount);
-
+
if (ctxMap != null) {
// There are operations with argCount arguments
// First try to find with direct types
@@ -1682,7 +1681,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
}
}
}
-
+
return op;
}
@@ -1699,7 +1698,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
if (argcountOpsMap != null) {
// There are operations with the given name
final TypeMap<Object, Object> ctxMap = argcountOpsMap.get(0);
-
+
if (ctxMap != null) {
// There are operations with 0 arguments
// First try to find with direct type
@@ -1717,7 +1716,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
}
}
}
-
+
return op;
}
@@ -1735,7 +1734,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
if (argcountOpsMap != null) {
// There are operations with the given name
final TypeMap<Object, Object> ctxMap = argcountOpsMap.get(1);
-
+
if (ctxMap != null) {
// There are operations with 1 argument
// First try to find with direct types
@@ -1771,7 +1770,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
}
}
}
-
+
return op;
}
@@ -1804,7 +1803,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
// There are operations with the given name
final int argCount = parameterTypes.length;
final TypeMap<Object, Object> ctxMap = argcountOpsMap.get(argCount);
-
+
if (ctxMap != null) {
// There are operations with argCount arguments
// Static operations must be defined in exact context type
@@ -1825,7 +1824,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
}
}
}
-
+
return op;
}
@@ -1842,14 +1841,14 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
if (argcountOpsMap != null) {
// There are operations with the given name
final TypeMap<Object, Object> ctxMap = argcountOpsMap.get(0);
-
+
if (ctxMap != null) {
// There are operations with 0 arguments
// Static operations must be defined in exact context type
op = (Operation)ctxMap.get(context);
}
}
-
+
return op;
}
@@ -1867,7 +1866,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
if (argcountOpsMap != null) {
// There are operations with the given name
final TypeMap<Object, Object> ctxMap = argcountOpsMap.get(1);
-
+
if (ctxMap != null) {
// There are operations with 1 argument
// Static operations must be defined in exact context type
@@ -1898,7 +1897,7 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
}
}
}
-
+
return op;
}
@@ -1924,12 +1923,12 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
* @return the operation, or <code>null</code>
*/
@SuppressWarnings("unchecked")
- private static Operation findOperationDirect(final TypeMap<Object, Object> typeMap, final Object[] parameterTypes,
+ private static Operation findOperationDirect(final TypeMap<Object, Object> typeMap, final Object[] parameterTypes,
final int argIndex) {
final int argCount = parameterTypes.length;
assert argIndex >= 0 && argIndex < argCount;
final Object argType = parameterTypes[argIndex];
-
+
if (argIndex < argCount - 1) {
final TypeMap<Object, Object> nestedTypeMap = (TypeMap<Object, Object>)typeMap.get(argType);
if (nestedTypeMap != null) {
@@ -1949,14 +1948,14 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
* @param argIndex
*/
@SuppressWarnings("unchecked")
- private static void findOperations(final TypeMap<Object, Object> typeMap, final Object[] parameterTypes,
+ private static void findOperations(final TypeMap<Object, Object> typeMap, final Object[] parameterTypes,
final Set<Operation> ops, final int argIndex) {
final int argCount = parameterTypes.length;
assert argIndex >= 0 && argIndex < argCount;
final Object argType = parameterTypes[argIndex];
final Set<Object> argTypeKeys = new HashSet<Object>();
typeMap.findAllKeys(argType, argTypeKeys);
-
+
if (argIndex < argCount - 1) {
for (final Object argTypeKey : argTypeKeys) {
// There are operations defined on the given parameter type so far...
@@ -2282,41 +2281,41 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
private void matchAllRecursive(final StackFrame frame, final TimingData timingData) {
final List<Rule> rules = getRules();
final Set<Rule> matchedRules = new LinkedHashSet<Rule>();
-
+
boolean outerMatch;
do {
outerMatch = false;
-
+
// Match automatic recursive rules
matchedRules.clear();
boolean match;
MATCHER:
- do {
- match = false;
- for (final Rule rule : rules) {
- // Only match rules for which all super-rules have already been matched
- if (!matchedRules.contains(rule) && matchedRules.containsAll(rule.getESuperRules())) {
- final boolean[] matchResult = rule.matchRecursive(frame);
- if (matchResult[1]) { // Guaranteed final match
- outerMatch = true;
- matchedRules.add(rule);
- break MATCHER;
- } else if (matchResult[0]) {
- match = true;
- matchedRules.add(rule);
- outerMatch |= !rule.isAbstract();
+ do {
+ match = false;
+ for (final Rule rule : rules) {
+ // Only match rules for which all super-rules have already been matched
+ if (!matchedRules.contains(rule) && matchedRules.containsAll(rule.getESuperRules())) {
+ final boolean[] matchResult = rule.matchRecursive(frame);
+ if (matchResult[1]) { // Guaranteed final match
+ outerMatch = true;
+ matchedRules.add(rule);
+ break MATCHER;
+ } else if (matchResult[0]) {
+ match = true;
+ matchedRules.add(rule);
+ outerMatch |= !rule.isAbstract();
+ }
}
}
- }
- } while (match);
+ } while (match);
for (final Rule rule : matchedRules) {
if (rule.applyFirst(frame)) {
break;
}
}
-
- } while (outerMatch);
+
+ } while (outerMatch);
if (timingData != null) {
timingData.finishRecursive();
@@ -2485,28 +2484,28 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
@Override
public Object eGet(final int featureID, final boolean resolve, final boolean coreType) {
switch (featureID) {
- case EmftvmPackage.EXEC_ENV__META_MODELS:
- return getMetaModels();
- case EmftvmPackage.EXEC_ENV__INPUT_MODELS:
- return getInputModels();
- case EmftvmPackage.EXEC_ENV__INOUT_MODELS:
- return getInoutModels();
- case EmftvmPackage.EXEC_ENV__OUTPUT_MODELS:
- return getOutputModels();
- case EmftvmPackage.EXEC_ENV__MODULES:
- return getModules();
- case EmftvmPackage.EXEC_ENV__MATCHES:
- if (resolve) return getMatches();
- return basicGetMatches();
- case EmftvmPackage.EXEC_ENV__TRACES:
- if (resolve) return getTraces();
- return basicGetTraces();
- case EmftvmPackage.EXEC_ENV__UNIQUE_RESULTS:
- return getUniqueResults();
- case EmftvmPackage.EXEC_ENV__JIT_DISABLED:
- return isJitDisabled();
- case EmftvmPackage.EXEC_ENV__CURRENT_PHASE:
- return getCurrentPhase();
+ case EmftvmPackage.EXEC_ENV__META_MODELS:
+ return getMetaModels();
+ case EmftvmPackage.EXEC_ENV__INPUT_MODELS:
+ return getInputModels();
+ case EmftvmPackage.EXEC_ENV__INOUT_MODELS:
+ return getInoutModels();
+ case EmftvmPackage.EXEC_ENV__OUTPUT_MODELS:
+ return getOutputModels();
+ case EmftvmPackage.EXEC_ENV__MODULES:
+ return getModules();
+ case EmftvmPackage.EXEC_ENV__MATCHES:
+ if (resolve) return getMatches();
+ return basicGetMatches();
+ case EmftvmPackage.EXEC_ENV__TRACES:
+ if (resolve) return getTraces();
+ return basicGetTraces();
+ case EmftvmPackage.EXEC_ENV__UNIQUE_RESULTS:
+ return getUniqueResults();
+ case EmftvmPackage.EXEC_ENV__JIT_DISABLED:
+ return isJitDisabled();
+ case EmftvmPackage.EXEC_ENV__CURRENT_PHASE:
+ return getCurrentPhase();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -2519,9 +2518,9 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
@Override
public void eSet(final int featureID, final Object newValue) {
switch (featureID) {
- case EmftvmPackage.EXEC_ENV__JIT_DISABLED:
- setJitDisabled((Boolean)newValue);
- return;
+ case EmftvmPackage.EXEC_ENV__JIT_DISABLED:
+ setJitDisabled((Boolean)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -2534,9 +2533,9 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
@Override
public void eUnset(final int featureID) {
switch (featureID) {
- case EmftvmPackage.EXEC_ENV__JIT_DISABLED:
- setJitDisabled(JIT_DISABLED_EDEFAULT);
- return;
+ case EmftvmPackage.EXEC_ENV__JIT_DISABLED:
+ setJitDisabled(JIT_DISABLED_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -2550,26 +2549,26 @@ public class ExecEnvImpl extends EObjectImpl implements ExecEnv {
@Override
public boolean eIsSet(final int featureID) {
switch (featureID) {
- case EmftvmPackage.EXEC_ENV__META_MODELS:
- return metaModels != null;
- case EmftvmPackage.EXEC_ENV__INPUT_MODELS:
- return inputModels != null;
- case EmftvmPackage.EXEC_ENV__INOUT_MODELS:
- return inoutModels != null;
- case EmftvmPackage.EXEC_ENV__OUTPUT_MODELS:
- return outputModels != null;
- case EmftvmPackage.EXEC_ENV__MODULES:
- return modules != null;
- case EmftvmPackage.EXEC_ENV__MATCHES:
- return matches != null;
- case EmftvmPackage.EXEC_ENV__TRACES:
- return traces != null;
- case EmftvmPackage.EXEC_ENV__UNIQUE_RESULTS:
- return uniqueResults != null;
- case EmftvmPackage.EXEC_ENV__JIT_DISABLED:
- return jitDisabled != JIT_DISABLED_EDEFAULT;
- case EmftvmPackage.EXEC_ENV__CURRENT_PHASE:
- return currentPhase != CURRENT_PHASE_EDEFAULT;
+ case EmftvmPackage.EXEC_ENV__META_MODELS:
+ return metaModels != null;
+ case EmftvmPackage.EXEC_ENV__INPUT_MODELS:
+ return inputModels != null;
+ case EmftvmPackage.EXEC_ENV__INOUT_MODELS:
+ return inoutModels != null;
+ case EmftvmPackage.EXEC_ENV__OUTPUT_MODELS:
+ return outputModels != null;
+ case EmftvmPackage.EXEC_ENV__MODULES:
+ return modules != null;
+ case EmftvmPackage.EXEC_ENV__MATCHES:
+ return matches != null;
+ case EmftvmPackage.EXEC_ENV__TRACES:
+ return traces != null;
+ case EmftvmPackage.EXEC_ENV__UNIQUE_RESULTS:
+ return uniqueResults != null;
+ case EmftvmPackage.EXEC_ENV__JIT_DISABLED:
+ return jitDisabled != JIT_DISABLED_EDEFAULT;
+ case EmftvmPackage.EXEC_ENV__CURRENT_PHASE:
+ return currentPhase != CURRENT_PHASE_EDEFAULT;
}
return super.eIsSet(featureID);
}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/MetamodelImpl.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/MetamodelImpl.java
index 4851ef5e..fba86cb2 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/MetamodelImpl.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/MetamodelImpl.java
@@ -1,5 +1,6 @@
/*******************************************************************************
- * Copyright (c) 2011 Vrije Universiteit Brussel.
+ * Copyright (c) 2011-2012 Vrije Universiteit Brussel.
+ * Copyright (c) 2013-2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -78,7 +79,7 @@ public class MetamodelImpl extends ModelImpl implements Metamodel {
* {@inheritDoc}
* <!-- end-user-doc -->
*/
- public synchronized EClassifier findType(String typeName) {
+ public synchronized EClassifier findType(final String typeName) {
if (types == null) {
types = createTypeTable(ambiguousTypes);
}
@@ -113,10 +114,10 @@ public class MetamodelImpl extends ModelImpl implements Metamodel {
* @param ignore the set of objects to ignore
* @param ambiguousTypes the set of ambiguous type names (more than one occurrence)
*/
- private static void registerTypeChain(
- final Map<String, EClassifier> types,
+ public static void registerTypeChain(
+ final Map<String, EClassifier> types,
final Resource res,
- final String ns,
+ final String ns,
final Set<Object> ignore,
final Set<String> ambiguousTypes) {
if (res != null && !ignore.contains(res)) {
@@ -134,12 +135,12 @@ public class MetamodelImpl extends ModelImpl implements Metamodel {
* @param ambiguousTypes the set of ambiguous type names (more than one occurrence)
*/
private static void registerTypeChain(
- final Map<String, EClassifier> types,
+ final Map<String, EClassifier> types,
final EList<? extends EObject> objects,
- final String ns,
+ final String ns,
final Set<Object> ignore,
final Set<String> ambiguousTypes) {
- for (EObject o : objects) {
+ for (final EObject o : objects) {
switch (o.eClass().getClassifierID()) {
case EcorePackage.EPACKAGE:
String pname = ((EPackage)o).getName();
@@ -148,7 +149,7 @@ public class MetamodelImpl extends ModelImpl implements Metamodel {
}
registerTypeChain(types, o.eContents(), pname, ignore, ambiguousTypes);
break;
- // Fix for bug # 423597: switch on all concrete EClassifier sub-types
+ // Fix for bug # 423597: switch on all concrete EClassifier sub-types
case EcorePackage.EDATA_TYPE:
case EcorePackage.EENUM:
case EcorePackage.ECLASS:
@@ -173,9 +174,9 @@ public class MetamodelImpl extends ModelImpl implements Metamodel {
* @param ambiguousTypes the set of ambiguous type names (more than one occurrence)
*/
private static void registerTypeChain(
- final Map<String, EClassifier> types,
+ final Map<String, EClassifier> types,
final EClassifier type,
- final String ns,
+ final String ns,
final Set<Object> ignore,
final Set<String> ambiguousTypes) {
if (ignore.contains(type)) {
@@ -186,25 +187,25 @@ public class MetamodelImpl extends ModelImpl implements Metamodel {
registerSingleType(types, type.getName(), type, ambiguousTypes);
if (type instanceof EClass) {
final EClass cls = (EClass)type;
- for (EStructuralFeature sf : cls.getEStructuralFeatures()) {
- EClassifier eType = sf.getEType();
+ for (final EStructuralFeature sf : cls.getEStructuralFeatures()) {
+ final EClassifier eType = sf.getEType();
if (eType != null) {
registerTypeChain(types, eType.eResource(), null, ignore, ambiguousTypes);
}
}
- for (EOperation op : cls.getEOperations()) {
+ for (final EOperation op : cls.getEOperations()) {
EClassifier eType = op.getEType();
if (eType != null) {
registerTypeChain(types, eType.eResource(), null, ignore, ambiguousTypes);
}
- for (EParameter p : op.getEParameters()) {
+ for (final EParameter p : op.getEParameters()) {
eType = p.getEType();
if (eType != null) {
registerTypeChain(types, eType.eResource(), null, ignore, ambiguousTypes);
}
}
}
- for (EClass superCls : cls.getESuperTypes()) {
+ for (final EClass superCls : cls.getESuperTypes()) {
registerTypeChain(types, superCls.eResource(), null, ignore, ambiguousTypes);
}
}
@@ -218,7 +219,7 @@ public class MetamodelImpl extends ModelImpl implements Metamodel {
* @param ambiguousTypes the set of ambiguous type names (more than one occurrence)
*/
private static void registerSingleType(
- final Map<String, EClassifier> types,
+ final Map<String, EClassifier> types,
final String typeName,
final EClassifier type,
final Set<String> ambiguousTypes) {
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ModelFactoryImpl.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ModelFactoryImpl.java
new file mode 100644
index 00000000..dca85bde
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ModelFactoryImpl.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2021 Dennis Wagelaar.
+ * 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:
+ * Dennis Wagelaar - initial API and
+ * implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.m2m.atl.emftvm.impl;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.m2m.atl.emftvm.EmftvmFactory;
+import org.eclipse.m2m.atl.emftvm.Metamodel;
+import org.eclipse.m2m.atl.emftvm.Model;
+import org.eclipse.m2m.atl.emftvm.ModelFactory;
+
+/**
+ * Default implementation for {@link ModelFactory}.
+ *
+ * @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
+ */
+public class ModelFactoryImpl implements ModelFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Model createModel(final Resource resource) {
+ final Model model = EmftvmFactory.eINSTANCE.createModel();
+ model.setResource(resource);
+ return model;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Metamodel createMetamodel(final Resource resource) {
+ final Metamodel metaModel = EmftvmFactory.eINSTANCE.createMetamodel();
+ metaModel.setResource(resource);
+ return metaModel;
+ }
+
+}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ModelImpl.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ModelImpl.java
index 71cc5bbb..55f82db8 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ModelImpl.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/ModelImpl.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright (c) 2011 Vrije Universiteit Brussel.
+ * Copyright (c) 2012, 2013, 2018, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -75,10 +76,12 @@ public class ModelImpl extends EObjectImpl implements Model {
*/
@Override
public boolean hasNext() {
- if (i < cache.size()) {
- return true;
- } else if (dataSource == null) {
- return false;
+ synchronized (cache) {
+ if (i < cache.size()) {
+ return true;
+ } else if (dataSource == null) {
+ return false;
+ }
}
if (!nextSet && inner.hasNext()) {
next = inner.next(); // support null values for next
@@ -109,12 +112,7 @@ public class ModelImpl extends EObjectImpl implements Model {
next = inner.next();
}
assert !nextSet && type.isInstance(next);
- if (++i > cache.size()) {
- assert dataSource != null; // cache not complete
- cache.add(next);
- } else {
- assert cache.contains(next);
- }
+ updateCache(next);
return next;
}
}
@@ -126,7 +124,7 @@ public class ModelImpl extends EObjectImpl implements Model {
* @param dataSource
* @param type the type of which to return the instances
*/
- public InstanceOfList(Iterable<EObject> dataSource, EClass type) {
+ public InstanceOfList(final Iterable<EObject> dataSource, final EClass type) {
super(dataSource);
this.type = type;
}
@@ -146,7 +144,7 @@ public class ModelImpl extends EObjectImpl implements Model {
* {@inheritDoc}
*/
@Override
- public boolean remove(Object o) {
+ public boolean remove(final Object o) {
// try to remove from cache - if not contained, nothing needs to be done
return cache.remove(o);
}
@@ -155,7 +153,7 @@ public class ModelImpl extends EObjectImpl implements Model {
* {@inheritDoc}
*/
@Override
- public boolean add(EObject o) {
+ public boolean add(final EObject o) {
// add to cache only if complete - if not contained, it will show up on the next iteration
synchronized (cache) {
if (dataSource == null) { // cache complete
@@ -215,7 +213,7 @@ public class ModelImpl extends EObjectImpl implements Model {
/**
* Cache of allInstancesOf().
*/
- protected Map<EClass, InstanceOfList> allInstancesMap = new HashMap<EClass, InstanceOfList>();
+ protected final Map<EClass, LazyList<EObject>> allInstancesMap = new HashMap<EClass, LazyList<EObject>>();
/**
* <!-- begin-user-doc -->
@@ -255,8 +253,8 @@ public class ModelImpl extends EObjectImpl implements Model {
* <!-- end-user-doc -->
* @generated
*/
- public void setResource(Resource newResource) {
- Resource oldResource = resource;
+ public void setResource(final Resource newResource) {
+ final Resource oldResource = resource;
resource = newResource;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EmftvmPackage.MODEL__RESOURCE, oldResource, resource));
@@ -278,8 +276,8 @@ public class ModelImpl extends EObjectImpl implements Model {
* <!-- end-user-doc -->
* @generated
*/
- public void setAllowInterModelReferences(boolean newAllowInterModelReferences) {
- boolean oldAllowInterModelReferences = allowInterModelReferences;
+ public void setAllowInterModelReferences(final boolean newAllowInterModelReferences) {
+ final boolean oldAllowInterModelReferences = allowInterModelReferences;
allowInterModelReferences = newAllowInterModelReferences;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EmftvmPackage.MODEL__ALLOW_INTER_MODEL_REFERENCES, oldAllowInterModelReferences, allowInterModelReferences));
@@ -313,7 +311,7 @@ public class ModelImpl extends EObjectImpl implements Model {
/**
* Adds <code>element</code> to the "allInstances" list for the given type and all its supertypes.
- *
+ *
* @param element
* the element to add
* @param type
@@ -323,7 +321,7 @@ public class ModelImpl extends EObjectImpl implements Model {
if (allInstancesMap.containsKey(type)) {
allInstancesMap.get(type).add(element);
}
- for (EClass superType : type.getESuperTypes()) {
+ for (final EClass superType : type.getESuperTypes()) {
addElement(element, superType);
}
}
@@ -339,17 +337,17 @@ public class ModelImpl extends EObjectImpl implements Model {
if (!resContents.remove(element)) {
throw new IllegalArgumentException(String.format("Element %s not contained as a root element in this model", element));
}
- for (EObject child : new ArrayList<EObject>(element.eContents())) {
+ for (final EObject child : new ArrayList<EObject>(element.eContents())) {
assert child.eResource() == null;
// adding children to a container removes them from their previous container
- resContents.add(child);
+ resContents.add(child);
}
deleteElement(element, element.eClass());
}
/**
* Deletes <code>element</code> from the "allInstances" list for the given type and all its supertypes.
- *
+ *
* @param element
* the element to delete
* @param type
@@ -359,7 +357,7 @@ public class ModelImpl extends EObjectImpl implements Model {
if (allInstancesMap.containsKey(type)) {
allInstancesMap.get(type).remove(element);
}
- for (EClass superType : type.getESuperTypes()) {
+ for (final EClass superType : type.getESuperTypes()) {
deleteElement(element, superType);
}
}
@@ -371,12 +369,12 @@ public class ModelImpl extends EObjectImpl implements Model {
* @generated
*/
@Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ public Object eGet(final int featureID, final boolean resolve, final boolean coreType) {
switch (featureID) {
- case EmftvmPackage.MODEL__RESOURCE:
- return getResource();
- case EmftvmPackage.MODEL__ALLOW_INTER_MODEL_REFERENCES:
- return isAllowInterModelReferences();
+ case EmftvmPackage.MODEL__RESOURCE:
+ return getResource();
+ case EmftvmPackage.MODEL__ALLOW_INTER_MODEL_REFERENCES:
+ return isAllowInterModelReferences();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -388,14 +386,14 @@ public class ModelImpl extends EObjectImpl implements Model {
* @generated
*/
@Override
- public void eSet(int featureID, Object newValue) {
+ public void eSet(final int featureID, final Object newValue) {
switch (featureID) {
- case EmftvmPackage.MODEL__RESOURCE:
- setResource((Resource)newValue);
- return;
- case EmftvmPackage.MODEL__ALLOW_INTER_MODEL_REFERENCES:
- setAllowInterModelReferences((Boolean)newValue);
- return;
+ case EmftvmPackage.MODEL__RESOURCE:
+ setResource((Resource)newValue);
+ return;
+ case EmftvmPackage.MODEL__ALLOW_INTER_MODEL_REFERENCES:
+ setAllowInterModelReferences((Boolean)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -407,14 +405,14 @@ public class ModelImpl extends EObjectImpl implements Model {
* @generated
*/
@Override
- public void eUnset(int featureID) {
+ public void eUnset(final int featureID) {
switch (featureID) {
- case EmftvmPackage.MODEL__RESOURCE:
- setResource(RESOURCE_EDEFAULT);
- return;
- case EmftvmPackage.MODEL__ALLOW_INTER_MODEL_REFERENCES:
- setAllowInterModelReferences(ALLOW_INTER_MODEL_REFERENCES_EDEFAULT);
- return;
+ case EmftvmPackage.MODEL__RESOURCE:
+ setResource(RESOURCE_EDEFAULT);
+ return;
+ case EmftvmPackage.MODEL__ALLOW_INTER_MODEL_REFERENCES:
+ setAllowInterModelReferences(ALLOW_INTER_MODEL_REFERENCES_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -426,12 +424,12 @@ public class ModelImpl extends EObjectImpl implements Model {
* @generated
*/
@Override
- public boolean eIsSet(int featureID) {
+ public boolean eIsSet(final int featureID) {
switch (featureID) {
- case EmftvmPackage.MODEL__RESOURCE:
- return RESOURCE_EDEFAULT == null ? resource != null : !RESOURCE_EDEFAULT.equals(resource);
- case EmftvmPackage.MODEL__ALLOW_INTER_MODEL_REFERENCES:
- return allowInterModelReferences != ALLOW_INTER_MODEL_REFERENCES_EDEFAULT;
+ case EmftvmPackage.MODEL__RESOURCE:
+ return RESOURCE_EDEFAULT == null ? resource != null : !RESOURCE_EDEFAULT.equals(resource);
+ case EmftvmPackage.MODEL__ALLOW_INTER_MODEL_REFERENCES:
+ return allowInterModelReferences != ALLOW_INTER_MODEL_REFERENCES_EDEFAULT;
}
return super.eIsSet(featureID);
}
@@ -446,7 +444,7 @@ public class ModelImpl extends EObjectImpl implements Model {
public String toString() {
if (eIsProxy()) return super.toString();
- StringBuffer result = new StringBuffer(super.toString());
+ final StringBuffer result = new StringBuffer(super.toString());
result.append(" (resource: ");
result.append(resource.getURI() == null ? resource : resource.getURI());
result.append(')');
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/launcher/compat/EMFTVMLauncher.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/launcher/compat/EMFTVMLauncher.java
index 6a5d768d..77e88dc5 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/launcher/compat/EMFTVMLauncher.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/launcher/compat/EMFTVMLauncher.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2017 Dennis Wagelaar.
+ * Copyright (c) 2017, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
- *
+ *
* Contributors:
* Dennis Wagelaar - initial API and implementation
*******************************************************************************/
@@ -51,7 +51,7 @@ import org.eclipse.m2m.atl.emftvm.util.VMMonitor;
/**
* The EMFVM implementation of the {@link ILauncher} interface.
- *
+ *
* @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
*/
public class EMFTVMLauncher implements ILauncher {
@@ -84,7 +84,7 @@ public class EMFTVMLauncher implements ILauncher {
/**
* Adds any model to the local map.
- *
+ *
* @param model
* the {@link IModel}
* @param name
@@ -93,7 +93,7 @@ public class EMFTVMLauncher implements ILauncher {
* the model reference model name
* @return the EMFTVM {@link Model}
*/
- protected Model addModel(IModel model, String name, String referenceModelName) {
+ protected Model addModel(final IModel model, final String name, final String referenceModelName) {
final Model emftvmModel;
if (models.containsKey(name)) {
ATLLogger.warning(Messages.getString("EMFTVMLauncher.MODEL_REGISTERED", name)); //$NON-NLS-1$
@@ -106,18 +106,17 @@ public class EMFTVMLauncher implements ILauncher {
final EMFInjector emfInjector;
try {
emfInjector = (EMFInjector) CoreService.getInjector(MODEL_FACTORY_NAME);
- } catch (ATLCoreException e) {
+ } catch (final ATLCoreException e) {
throw new VMException(null, e.getLocalizedMessage(), e);
}
emfInjector.inject(emfModel, outputResourceSet.createResource(URI.createURI(name + ".xmi"))); //$NON-NLS-1$
}
- emftvmModel = EmftvmFactory.eINSTANCE.createModel();
- emftvmModel.setResource(emfModel.getResource());
+ emftvmModel = EmftvmFactory.eINSTANCE.createModel(emfModel.getResource());
}
if (!models.containsKey(referenceModelName)) {
models.put(referenceModelName, model.getReferenceModel());
- final Metamodel metamodel = EmftvmFactory.eINSTANCE.createMetamodel();
- metamodel.setResource(((EMFReferenceModel) model.getReferenceModel()).getResource());
+ final Metamodel metamodel = EmftvmFactory.eINSTANCE
+ .createMetamodel(((EMFReferenceModel) model.getReferenceModel()).getResource());
execEnv.registerMetaModel(referenceModelName, metamodel);
}
return emftvmModel;
@@ -125,11 +124,11 @@ public class EMFTVMLauncher implements ILauncher {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.m2m.atl.core.launch.ILauncher#addInModel(org.eclipse.m2m.atl.core.IModel,
* java.lang.String, java.lang.String)
*/
- public void addInModel(IModel model, String name, String referenceModelName) {
+ public void addInModel(final IModel model, final String name, final String referenceModelName) {
model.setIsTarget(false);
final Model emftvmModel = addModel(model, name, referenceModelName);
if (emftvmModel != null) {
@@ -139,11 +138,11 @@ public class EMFTVMLauncher implements ILauncher {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.m2m.atl.core.launch.ILauncher#addInOutModel(org.eclipse.m2m.atl.core.IModel,
* java.lang.String, java.lang.String)
*/
- public void addInOutModel(IModel model, String name, String referenceModelName) {
+ public void addInOutModel(final IModel model, final String name, final String referenceModelName) {
model.setIsTarget(true);
final Model emftvmModel = addModel(model, name, referenceModelName);
if (emftvmModel != null) {
@@ -153,11 +152,11 @@ public class EMFTVMLauncher implements ILauncher {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.m2m.atl.core.launch.ILauncher#addOutModel(org.eclipse.m2m.atl.core.IModel,
* java.lang.String, java.lang.String)
*/
- public void addOutModel(IModel model, String name, String referenceModelName) {
+ public void addOutModel(final IModel model, final String name, final String referenceModelName) {
model.setIsTarget(true);
final Model emftvmModel = addModel(model, name, referenceModelName);
if (emftvmModel != null) {
@@ -167,11 +166,11 @@ public class EMFTVMLauncher implements ILauncher {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.m2m.atl.core.launch.ILauncher#addLibrary(java.lang.String,
* java.lang.Object)
*/
- public void addLibrary(String name, Object library) {
+ public void addLibrary(final String name, final Object library) {
if (libraries.containsKey(name)) {
ATLLogger.warning(Messages.getString("EMFTVMLauncher.LIBRARY_REGISTERED", name)); //$NON-NLS-1$
} else {
@@ -181,10 +180,10 @@ public class EMFTVMLauncher implements ILauncher {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.m2m.atl.core.launch.ILauncher#initialize(java.util.Map)
*/
- public void initialize(Map<String, Object> parameters) {
+ public void initialize(final Map<String, Object> parameters) {
models = new HashMap<String, IModel>();
libraries = new HashMap<String, Module>();
moduleResourceSet = new ResourceSetImpl();
@@ -196,7 +195,7 @@ public class EMFTVMLauncher implements ILauncher {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.m2m.atl.core.launch.ILauncher#launch(java.lang.String,
* org.eclipse.core.runtime.IProgressMonitor, java.util.Map,
* java.lang.Object[])
@@ -208,7 +207,7 @@ public class EMFTVMLauncher implements ILauncher {
/**
* Launches the transformation with preloaded modules.
- *
+ *
* @param tool
* the execution tool
* @param monitor
@@ -220,13 +219,13 @@ public class EMFTVMLauncher implements ILauncher {
* @return the execution result
*/
protected Object internalLaunch(final VMMonitor tool, final IProgressMonitor monitor,
- final Map<String, Object> options, Object... modules) {
+ final Map<String, Object> options, final Object... modules) {
getModuleFromObject(modules[0]);
for (int i = 1; i < modules.length; i++) {
getModuleFromObject(modules[i]);
}
- for (Model model : LazyCollections.asLazySet(execEnv.getInoutModels().values())
+ for (final Model model : LazyCollections.asLazySet(execEnv.getInoutModels().values())
.union(LazyCollections.asLazySet(execEnv.getOutputModels().values()))) {
model.setAllowInterModelReferences(
LauncherService.getBooleanOption(options.get("allowInterModelReferences"), false)); //$NON-NLS-1$
@@ -235,7 +234,7 @@ public class EMFTVMLauncher implements ILauncher {
execEnv.setMonitor(tool);
execEnv.setJitDisabled(LauncherService.getBooleanOption(options.get("jitDisabled"), false)); //$NON-NLS-1$
timingData.finishLoading();
-
+
final Object result = execEnv.run(timingData);
timingData.finish();
@@ -247,7 +246,7 @@ public class EMFTVMLauncher implements ILauncher {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.m2m.atl.core.launch.ILauncher#loadModule(java.io.InputStream)
*/
public Module loadModule(final InputStream inputStream) {
@@ -261,19 +260,19 @@ public class EMFTVMLauncher implements ILauncher {
resource.setURI(URI.createURI(EMF_URI_PREFIX + path + DefaultModuleResolver.FILE_EXT));
execEnv.loadModule(moduleResolver, module.getName());
return module;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new VMException(null, e.getLocalizedMessage(), e);
}
}
/**
* Load a module if necessary.
- *
+ *
* @param module
* the given {@link Module} or {@link InputStream}.
* @return the {@link Module}
*/
- protected Module getModuleFromObject(Object module) {
+ protected Module getModuleFromObject(final Object module) {
if (module instanceof InputStream) {
return loadModule((InputStream) module);
} else if (module instanceof Module) {
@@ -284,24 +283,24 @@ public class EMFTVMLauncher implements ILauncher {
/**
* Finds the first module in {@link Resource}
- *
+ *
* <pre>
* r
* </pre>
- *
+ *
* .
- *
+ *
* @param r
* @return the module with the given name inside
- *
+ *
* <pre>
* r
* </pre>
- *
+ *
* , or <code>null</code>
*/
private Module findModule(final Resource r) throws ModuleNotFoundException {
- for (EObject o : r.getContents()) {
+ for (final EObject o : r.getContents()) {
if (o instanceof Module) {
return (Module) o;
}
@@ -311,25 +310,25 @@ public class EMFTVMLauncher implements ILauncher {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.m2m.atl.core.launch.ILauncher#getModel(java.lang.String)
*/
- public IModel getModel(String modelName) {
+ public IModel getModel(final String modelName) {
return models.get(modelName);
}
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.m2m.atl.core.launch.ILauncher#getLibrary(java.lang.String)
*/
- public Object getLibrary(String libraryName) {
+ public Object getLibrary(final String libraryName) {
return libraries.get(libraryName);
}
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.m2m.atl.core.launch.ILauncher#getDefaultModelFactoryName()
*/
public String getDefaultModelFactoryName() {
@@ -338,7 +337,7 @@ public class EMFTVMLauncher implements ILauncher {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.m2m.atl.core.launch.ILauncher#getModes()
*/
public String[] getModes() {
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/EMFTVMUtil.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/EMFTVMUtil.java
index e43a0ad5..99e8c2ee 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/EMFTVMUtil.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/EMFTVMUtil.java
@@ -1,5 +1,6 @@
/*******************************************************************************
- * Copyright (c) 2011-2018 Dennis Wagelaar, Vrije Universiteit Brussel.
+ * Copyright (c) 2011, 2012 Vrije Universiteit Brussel.
+ * Copyright (c) 2012-2019, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -85,7 +86,7 @@ public final class EMFTVMUtil {
* {@inheritDoc}
*/
@Override
- public Object defaultCase(EObject object) {
+ public Object defaultCase(final EObject object) {
throw new IllegalArgumentException("Unsupported type: " + object);
}
@@ -93,7 +94,7 @@ public final class EMFTVMUtil {
* {@inheritDoc}
*/
@Override
- public Object caseEClass(EClass object) {
+ public Object caseEClass(final EClass object) {
return object;
}
@@ -101,7 +102,7 @@ public final class EMFTVMUtil {
* {@inheritDoc}
*/
@Override
- public Object caseEClassifier(EClassifier object) {
+ public Object caseEClassifier(final EClassifier object) {
final Class<?> ic = object.getInstanceClass();
if (ic == null) {
throw new IllegalArgumentException(String.format("Primitive EMF type without instance class %s", object));
@@ -113,7 +114,7 @@ public final class EMFTVMUtil {
* {@inheritDoc}
*/
@Override
- public Object caseEEnum(EEnum object) {
+ public Object caseEEnum(final EEnum object) {
return EnumLiteral.class;
}
@@ -278,8 +279,7 @@ public final class EMFTVMUtil {
*/
public static synchronized Metamodel getEcoreMetamodel() {
if (ecoreMetamodel == null) {
- ecoreMetamodel = EmftvmFactory.eINSTANCE.createMetamodel();
- ecoreMetamodel.setResource(EcorePackage.eINSTANCE.eResource());
+ ecoreMetamodel = EmftvmFactory.eINSTANCE.createMetamodel(EcorePackage.eINSTANCE.eResource());
}
return ecoreMetamodel;
}
@@ -291,8 +291,7 @@ public final class EMFTVMUtil {
*/
public static synchronized Metamodel getEmfTvmMetamodel() {
if (emfTvmMetamodel == null) {
- emfTvmMetamodel = EmftvmFactory.eINSTANCE.createMetamodel();
- emfTvmMetamodel.setResource(EmftvmPackage.eINSTANCE.eResource());
+ emfTvmMetamodel = EmftvmFactory.eINSTANCE.createMetamodel(EmftvmPackage.eINSTANCE.eResource());
}
return emfTvmMetamodel;
}
@@ -304,8 +303,7 @@ public final class EMFTVMUtil {
*/
public static synchronized Metamodel getTraceMetamodel() {
if (traceMetamodel == null) {
- traceMetamodel = EmftvmFactory.eINSTANCE.createMetamodel();
- traceMetamodel.setResource(TracePackage.eINSTANCE.eResource());
+ traceMetamodel = EmftvmFactory.eINSTANCE.createMetamodel(TracePackage.eINSTANCE.eResource());
}
return traceMetamodel;
}
@@ -2225,6 +2223,8 @@ public final class EMFTVMUtil {
ATLLogger.fine(e.getMessage());
} catch (final ClassNotFoundException e) {
ATLLogger.fine(e.getMessage());
+ } catch (final NoClassDefFoundError e) {
+ ATLLogger.fine(e.getMessage());
}
ATLLogger.info("Could not find workspace root; falling back to native java.io.File path resolution");
return new File(path);
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/LazyList.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/LazyList.java
index a5ec2bed..f8ac910a 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/LazyList.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/LazyList.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright (c) 2011-2012 Vrije Universiteit Brussel.
+ * Copyright (c) 2012-2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -46,9 +47,10 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
/**
* Creates a {@link NonCachingList} around <code>dataSource</code>.
- * @param dataSource the underlying {@link LazyList}
+ *
+ * @param dataSource the underlying (lazy) collection
*/
- public NonCachingList(final LazyList<E> dataSource) {
+ public NonCachingList(final Iterable<E> dataSource) {
super(dataSource);
assert dataSource != null;
}
@@ -96,7 +98,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public E get(int index) {
+ public E get(final int index) {
final int size = ((List<E>)dataSource).size();
return index < size ? ((List<E>)dataSource).get(index) : s.get(index - size);
}
@@ -105,7 +107,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public int indexOf(Object o) {
+ public int indexOf(final Object o) {
final int indexOf = ((List<E>)dataSource).indexOf(o);
if (indexOf > -1) {
return indexOf;
@@ -126,7 +128,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public int lastIndexOf(Object o) {
+ public int lastIndexOf(final Object o) {
final int lastIndexOf = s.lastIndexOf(o);
if (lastIndexOf > -1) {
return ((List<E>)dataSource).size() + lastIndexOf;
@@ -147,7 +149,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public ListIterator<E> listIterator(int index) {
+ public ListIterator<E> listIterator(final int index) {
return new UnionListIterator(s, index);
}
@@ -155,7 +157,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public boolean contains(Object o) {
+ public boolean contains(final Object o) {
return ((Collection<E>)dataSource).contains(o) ||
s.contains(o);
}
@@ -164,7 +166,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public int count(Object object) {
+ public int count(final Object object) {
return ((LazyCollection<E>)dataSource).count(object) + s.count(object);
}
@@ -207,16 +209,16 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* @author <a href="mailto:dennis.wagelaar@vub.ac.be">Dennis Wagelaar</a>
*/
public class AppendListIterator extends WrappedListIterator {
-
+
protected boolean beforeTail = true;
-
+
/**
* Creates a new {@link AppendListIterator}.
*/
public AppendListIterator() {
super();
}
-
+
/**
* Creates a new {@link AppendListIterator}.
* @param index the iterator starting index.
@@ -227,7 +229,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
next();
}
}
-
+
/**
* {@inheritDoc}
*/
@@ -236,7 +238,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
assert beforeTail || !inner.hasNext(); // not beforeTail implies not inner.hasNext()
return beforeTail;
}
-
+
/**
* {@inheritDoc}
*/
@@ -250,7 +252,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
throw new NoSuchElementException();
}
-
+
/**
* {@inheritDoc}
*/
@@ -258,7 +260,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public int nextIndex() {
return inner.nextIndex() + (beforeTail ? 0 : 1);
}
-
+
/**
* {@inheritDoc}
*/
@@ -266,7 +268,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public boolean hasPrevious() {
return !beforeTail || inner.hasPrevious();
}
-
+
/**
* {@inheritDoc}
*/
@@ -278,7 +280,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
return inner.previous();
}
-
+
/**
* {@inheritDoc}
*/
@@ -286,7 +288,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public int previousIndex() {
return inner.previousIndex() + (beforeTail ? 0 : 1);
}
-
+
}
/**
@@ -355,7 +357,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
*/
@Override
public boolean contains(final Object o) {
- return (object == null ? o == null : object.equals(o)) ||
+ return (object == null ? o == null : object.equals(o)) ||
((Collection<E>)dataSource).contains(o);
}
@@ -364,7 +366,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
*/
@Override
public int count(final Object o) {
- return (object == null ? o == null : object.equals(o)) ? 1 : 0 +
+ return (object == null ? o == null : object.equals(o)) ? 1 : 0 +
((LazyCollection<E>)dataSource).count(o);
}
@@ -407,7 +409,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public ListIterator<E> listIterator(final int index) {
return new AppendListIterator(index);
}
-
+
}
/**
@@ -423,16 +425,16 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* @author <a href="mailto:dennis.wagelaar@vub.ac.be">Dennis Wagelaar</a>
*/
public class PrependIterator extends WrappedIterator {
-
+
protected boolean beforeHead = true;
-
+
/**
* Creates a new {@link PrependIterator}.
*/
public PrependIterator() {
super();
}
-
+
/**
* {@inheritDoc}
*/
@@ -440,7 +442,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public boolean hasNext() {
return beforeHead || inner.hasNext();
}
-
+
/**
* {@inheritDoc}
*/
@@ -459,16 +461,16 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* @author <a href="mailto:dennis.wagelaar@vub.ac.be">Dennis Wagelaar</a>
*/
public class PrependListIterator extends WrappedListIterator {
-
+
protected boolean beforeHead = true;
-
+
/**
* Creates a new {@link PrependListIterator}.
*/
public PrependListIterator() {
super();
}
-
+
/**
* Creates a new {@link PrependListIterator}.
* @param index the iterator starting index.
@@ -477,7 +479,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
super(index < 1 ? index : index - 1);
this.beforeHead = index < 1;
}
-
+
/**
* {@inheritDoc}
*/
@@ -485,7 +487,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public boolean hasNext() {
return beforeHead || inner.hasNext();
}
-
+
/**
* {@inheritDoc}
*/
@@ -497,7 +499,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
return inner.next();
}
-
+
/**
* {@inheritDoc}
*/
@@ -508,7 +510,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
return inner.nextIndex() + 1;
}
-
+
/**
* {@inheritDoc}
*/
@@ -517,7 +519,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
assert beforeHead || !inner.hasPrevious(); // not beforeHead implies not inner.hasPrevious()
return !beforeHead;
}
-
+
/**
* {@inheritDoc}
*/
@@ -531,7 +533,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
throw new NoSuchElementException();
}
-
+
/**
* {@inheritDoc}
*/
@@ -542,7 +544,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
return inner.previousIndex() + 1;
}
-
+
}
/**
@@ -602,7 +604,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public int lastIndexOf(Object o) {
+ public int lastIndexOf(final Object o) {
final int lastIndex = ((List<E>)dataSource).lastIndexOf(o) + 1;
if (lastIndex > 0) {
return lastIndex;
@@ -630,10 +632,10 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public ListIterator<E> listIterator(int index) {
+ public ListIterator<E> listIterator(final int index) {
return new PrependListIterator(index);
}
-
+
}
/**
@@ -651,16 +653,16 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* @author <a href="mailto:dennis.wagelaar@vub.ac.be">Dennis Wagelaar</a>
*/
public class InsertAtIterator extends WrappedIterator {
-
+
protected int i = -1;
-
+
/**
* Creates a new {@link InsertAtIterator}.
*/
public InsertAtIterator() {
super();
}
-
+
/**
* {@inheritDoc}
*/
@@ -668,7 +670,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public boolean hasNext() {
return i < index || inner.hasNext();
}
-
+
/**
* {@inheritDoc}
*/
@@ -687,16 +689,16 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* @author <a href="mailto:dennis.wagelaar@vub.ac.be">Dennis Wagelaar</a>
*/
public class InsertAtListIterator extends WrappedListIterator {
-
+
protected int i = -1;
-
+
/**
* Creates a new {@link InsertAtListIterator}.
*/
public InsertAtListIterator() {
super();
}
-
+
/**
* Creates a new {@link InsertAtListIterator}.
* @param index the iterator starting index, starting from 0 instead of 1.
@@ -705,7 +707,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
super(index < InsertAtList.this.index ? index : index - 1);
this.i = index - 1;
}
-
+
/**
* {@inheritDoc}
*/
@@ -713,7 +715,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public boolean hasNext() {
return i < index || inner.hasNext();
}
-
+
/**
* {@inheritDoc}
*/
@@ -724,7 +726,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
return inner.next();
}
-
+
/**
* {@inheritDoc}
*/
@@ -732,7 +734,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public int nextIndex() {
return i + 1;
}
-
+
/**
* {@inheritDoc}
*/
@@ -740,7 +742,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public boolean hasPrevious() {
return i >= index || inner.hasPrevious();
}
-
+
/**
* {@inheritDoc}
*/
@@ -751,7 +753,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
return inner.previous();
}
-
+
/**
* {@inheritDoc}
*/
@@ -759,7 +761,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public int previousIndex() {
return i;
}
-
+
}
protected final int index;
@@ -887,7 +889,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public ListIterator<E> listIterator(final int index) {
return new InsertAtListIterator(index);
}
-
+
}
/**
@@ -1010,7 +1012,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public ListIterator<E> listIterator(final int index) {
return new SubListListIterator(fromIndex, toIndex, index);
}
-
+
}
/**
@@ -1028,7 +1030,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
super(dataSource);
this.last = dataSource.size() - 1;
}
-
+
/**
* {@inheritDoc}
*/
@@ -1044,7 +1046,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public E last() {
return ((List<E>)dataSource).get(0);
}
-
+
/**
* {@inheritDoc}
*/
@@ -1052,7 +1054,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public E get(final int index) {
return ((List<E>)dataSource).get(last - index);
}
-
+
/**
* {@inheritDoc}
*/
@@ -1064,7 +1066,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
return -1;
}
-
+
/**
* {@inheritDoc}
*/
@@ -1076,7 +1078,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
return -1;
}
-
+
/**
* {@inheritDoc}
*/
@@ -1084,7 +1086,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public boolean contains(final Object o) {
return ((List<E>)dataSource).contains(o);
}
-
+
/**
* {@inheritDoc}
*/
@@ -1092,7 +1094,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public boolean isEmpty() {
return ((List<E>)dataSource).isEmpty();
}
-
+
/**
* {@inheritDoc}
*/
@@ -1100,7 +1102,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public Iterator<E> iterator() {
return new ReverseIterator(last);
}
-
+
/**
* {@inheritDoc}
*/
@@ -1108,7 +1110,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public int size() {
return last + 1;
}
-
+
/**
* {@inheritDoc}
*/
@@ -1116,7 +1118,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public ListIterator<E> listIterator() {
return new ReverseListIterator(last);
}
-
+
/**
* {@inheritDoc}
*/
@@ -1124,12 +1126,12 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
public ListIterator<E> listIterator(final int index) {
return new ReverseListIterator(last, index);
}
-
+
}
/**
* {@link LazyList} that represents a range running from a first to last {@link Integer}.
- *
+ *
* @author <a href="mailto:dennis.wagelaar@vub.ac.be">Dennis Wagelaar</a>
*/
public static class IntegerRangeList extends LazyList<Integer> {
@@ -1139,7 +1141,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
/**
* Creates a new {@link IntegerRangeList}.
- *
+ *
* @param first
* the first object of the range to include
* @param last
@@ -1175,7 +1177,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public Integer get(int index) {
+ public Integer get(final int index) {
final int element = first + index;
if (element > last) {
throw new IndexOutOfBoundsException(Integer.toString(index));
@@ -1187,7 +1189,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public int indexOf(Object o) {
+ public int indexOf(final Object o) {
if (contains(o)) {
return (Integer) o - first;
}
@@ -1206,7 +1208,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public int lastIndexOf(Object o) {
+ public int lastIndexOf(final Object o) {
// All elements of a range are unique
return indexOf(o);
}
@@ -1223,7 +1225,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public ListIterator<Integer> listIterator(int index) {
+ public ListIterator<Integer> listIterator(final int index) {
return new IntegerRangeListIterator(first, last, index);
}
@@ -1231,7 +1233,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public boolean contains(Object o) {
+ public boolean contains(final Object o) {
if (o instanceof Integer) {
final Integer obj = (Integer) o;
return (obj >= first && obj <= last);
@@ -1243,7 +1245,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public int count(Object object) {
+ public int count(final Object object) {
// All elements of a range are unique
return contains(object) ? 1 : 0;
}
@@ -1277,7 +1279,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
/**
* {@link LazyList} that represents a range running from a first to last {@link Long}.
- *
+ *
* @author <a href="mailto:dennis.wagelaar@vub.ac.be">Dennis Wagelaar</a>
*/
public static class LongRangeList extends LazyList<Long> {
@@ -1287,7 +1289,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
/**
* Creates a new {@link LongRangeList}.
- *
+ *
* @param first
* the first object of the range to include
* @param last
@@ -1323,7 +1325,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public Long get(int index) {
+ public Long get(final int index) {
final long element = first + index;
if (element > last) {
throw new IndexOutOfBoundsException(Integer.toString(index));
@@ -1335,7 +1337,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public int indexOf(Object o) {
+ public int indexOf(final Object o) {
if (contains(o)) {
return (int) ((Long) o - first);
}
@@ -1354,7 +1356,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public int lastIndexOf(Object o) {
+ public int lastIndexOf(final Object o) {
// All elements of a range are unique
return indexOf(o);
}
@@ -1371,7 +1373,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public ListIterator<Long> listIterator(int index) {
+ public ListIterator<Long> listIterator(final int index) {
return new LongRangeListIterator(first, last, index);
}
@@ -1379,7 +1381,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public boolean contains(Object o) {
+ public boolean contains(final Object o) {
if (o instanceof Long) {
final Long obj = (Long) o;
return (obj >= first && obj <= last);
@@ -1391,7 +1393,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* {@inheritDoc}
*/
@Override
- public int count(Object object) {
+ public int count(final Object object) {
// All elements of a range are unique
return contains(object) ? 1 : 0;
}
@@ -1425,7 +1427,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
/**
* {@link ListIterator} that returns first the elements of the underlying collection, then the elements of the other collection.
- *
+ *
* @author <a href="mailto:dennis.wagelaar@vub.ac.be">Dennis Wagelaar</a>
*/
public class UnionListIterator extends WrappedListIterator {
@@ -1549,9 +1551,9 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
return inner.previousIndex();
}
-
+
}
-
+
/**
* {@link LazyList} that implements the {@link LazyList#collect(CodeBlock)} function.
* @author <a href="dwagelaar@gmail.com">Dennis Wagelaar</a>
@@ -1559,7 +1561,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* @param <E> the element type
*/
public static class CollectList<E> extends LazyList<E> {
-
+
/**
* Creates a {@link CollectList} around <code>dataSource</code>.
* @param dataSource the underlying {@link LazyList}
@@ -1568,7 +1570,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
super(dataSource);
assert dataSource != null;
}
-
+
}
/**
@@ -1631,7 +1633,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
return ((List<E>)cache).get(index);
}
int i = 0;
- for (E e : this) {
+ for (final E e : this) {
if (i == index) {
return e;
}
@@ -1650,12 +1652,12 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
int i = 0;
if (o == null) {
- for (E e : this) {
+ for (final E e : this) {
if (e == null) return i;
i++;
}
} else {
- for (E e : this) {
+ for (final E e : this) {
if (o.equals(e)) return i;
i++;
}
@@ -1673,12 +1675,12 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
int i = 0;
int lastIndex = -1;
if (o == null) {
- for (E e : this) {
+ for (final E e : this) {
if (e == null) lastIndex = i;
i++;
}
} else {
- for (E e : this) {
+ for (final E e : this) {
if (e.equals(o)) lastIndex = i;
i++;
}
@@ -1737,23 +1739,23 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
/**
* {@inheritDoc}
- *
+ *
* Unsupported in this implementation.
* @throws UnsupportedOperationException
*/
- public void move(int newPosition, E object) {
+ public void move(final int newPosition, final E object) {
throw new UnsupportedOperationException();
}
/**
* {@inheritDoc}
- *
+ *
* Unsupported in this implementation.
* @throws UnsupportedOperationException
*/
- public E move(int newPosition, int oldPosition) {
+ public E move(final int newPosition, final int oldPosition) {
throw new UnsupportedOperationException();
}
@@ -1763,18 +1765,18 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
@Override
public boolean equals(final Object o) {
if (o == this) {
- return true;
+ return true;
}
if (!(o instanceof List<?>)) {
- return false;
+ return false;
}
final Iterator<E> e1 = iterator();
final Iterator<?> e2 = ((Collection<?>)o).iterator();
while (e1.hasNext() && e2.hasNext()) {
- E o1 = e1.next();
- Object o2 = e2.next();
- if (!(o1 == null ? o2 == null : o1.equals(o2)))
- return false;
+ final E o1 = e1.next();
+ final Object o2 = e2.next();
+ if (!(o1 == null ? o2 == null : o1.equals(o2)))
+ return false;
}
return !(e1.hasNext() || e2.hasNext());
}
@@ -1785,8 +1787,8 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
@Override
public int hashCode() {
int hashCode = 1;
- for (E obj : this) {
- hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
+ for (final E obj : this) {
+ hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
}
return hashCode;
}
@@ -1794,13 +1796,14 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
/**
* {@inheritDoc}
*/
+ @Override
public String asString(final ExecEnv env) {
return appendElements(new StringBuffer("Sequence{"), env).append('}').toString();
}
/**
* Returns the <code>i</code>-th element of this list. List index starts at 1.
- *
+ *
* @param i
* the element index
* @return The <code>i</code>-th element of this list.
@@ -1897,7 +1900,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* <p>
* <i>Lazy operation.</i>
* </p>
- *
+ *
* @param s
* the list to union with this
* @param index
@@ -1917,7 +1920,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* <p>
* <i>Lazy operation.</i>
* </p>
- *
+ *
* @return <b>if</b> self.type.elementType.oclIsKindOf(CollectionType) <b>then</b><br>
* &nbsp;&nbsp;self-&gt;iterate(c; acc : Sequence() = Sequence{} |<br>
* &nbsp;&nbsp;&nbsp;&nbsp;acc-&gt;union(c-&gt;asSequence() ) )<br>
@@ -1973,7 +1976,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* <p><i>Lazy operation.</i></p>
* @param lower the sub-list lower bound, inclusive
* @param upper the sub-list upper bound, inclusive
- * @return the sub-list of this list.
+ * @return the sub-list of this list.
*/
public LazyList<E> subSequence(final int lower, final int upper) {
return new SubList<E>(lower - 1, upper, this);
@@ -1985,6 +1988,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* @param object the object to include
* @return The sequence containing all elements of self plus <code>object</code> added as the last element.
*/
+ @Override
public LazyList<E> including(final E object) {
return append(object);
}
@@ -1994,7 +1998,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* <p>
* <i>Lazy operation.</i>
* </p>
- *
+ *
* @param object
* the object to include
* @param index
@@ -2015,7 +2019,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* <p>
* <i>Lazy operation.</i>
* </p>
- *
+ *
* @param coll
* the collection to include
* @return The collection containing all elements of self plus <code>coll</code>.
@@ -2030,7 +2034,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* <p>
* <i>Lazy operation.</i>
* </p>
- *
+ *
* @param coll
* the collection to include
* @param index
@@ -2051,11 +2055,12 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* <p>
* <i>Lazy operation.</i>
* </p>
- *
+ *
* @param object
* the object to exclude
* @return The sequence containing all elements of self apart from all occurrences of <code>object</code>.
*/
+ @Override
public LazyList<E> excluding(final Object object) {
return new LazyList<E>(this) {
@Override
@@ -2063,7 +2068,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
if (dataSource == null) {
return Collections.unmodifiableCollection(cache).iterator();
}
- return new ExcludingIterator(object);
+ return new ExcludingIterator(object);
}
};
}
@@ -2073,7 +2078,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* <p>
* <i>Lazy operation.</i>
* </p>
- *
+ *
* @param coll
* the collection to exclude
* @return The collection containing all elements of self minus <code>coll</code>.
@@ -2096,7 +2101,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* <p>
* <i>Lazy operation.</i>
* </p>
- *
+ *
* @return The sequence containing the same elements but with the opposite order.
*/
public LazyList<E> reverse() {
@@ -2104,7 +2109,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
}
/**
- * Returns the Sequence identical to the object itself. This operation exists for convenience reasons.
+ * Returns the Sequence identical to the object itself. This operation exists for convenience reasons.
* <p><i>Lazy operation.</i></p>
* @return The Sequence identical to the object itself. This operation exists for convenience reasons.
*/
@@ -2119,7 +2124,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* <p>
* <i>Lazy operation.</i>
* </p>
- *
+ *
* @param first
* the first object of the range to include
* @param last
@@ -2127,6 +2132,7 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
* @return The sequence containing all elements of self plus the sequence of <code>first</code> running to <code>last</code> added as
* the last elements
*/
+ @Override
@SuppressWarnings("unchecked")
public LazyList<E> includingRange(final E first, final E last) {
if (first instanceof Integer && last instanceof Integer) {
@@ -2246,12 +2252,12 @@ public class LazyList<E> extends LazyCollection<E> implements EList<E> {
final Iterator<Comparable<Object>> sortingKeys = new CollectIterator<Comparable<Object>>(inner, body, parentFrame);
final Object[] innerCopy = inner.toArray();
final Map<Object, Comparable<Object>> elementsToKeys = new HashMap<Object, Comparable<Object>>(innerCopy.length);
- for (Object o : innerCopy) {
+ for (final Object o : innerCopy) {
elementsToKeys.put(o, sortingKeys.next());
}
assert !sortingKeys.hasNext();
Arrays.sort(innerCopy, new Comparator<Object>() {
- public int compare(Object o1, Object o2) {
+ public int compare(final Object o1, final Object o2) {
return elementsToKeys.get(o1).compareTo(elementsToKeys.get(o2));
}
});
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/PluginExtensionUtil.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/PluginExtensionUtil.java
new file mode 100644
index 00000000..b895972b
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/PluginExtensionUtil.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2021 Dennis Wagelaar.
+ * 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:
+ * Dennis Wagelaar - initial API and
+ * implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.m2m.atl.emftvm.util;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.m2m.atl.emftvm.ModelFactory;
+
+/**
+ * Eclipse plug-in extension utility for {@link ModelFactory}.
+ *
+ * @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
+ */
+public interface PluginExtensionUtil {
+
+ /**
+ * Creates a {@link TypeMap} of {@link Resource} classes/interfaces to
+ * {@link ModelFactory} instances that can be used for those {@link Resource}s.
+ *
+ * @return a {@link TypeMap} of {@link Resource} classes/interfaces to
+ * {@link ModelFactory} instances
+ */
+ TypeMap<Class<?>, ModelFactory> createModelFactoryRegistry();
+
+}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/PluginExtensionUtilImpl.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/PluginExtensionUtilImpl.java
new file mode 100644
index 00000000..8ddf722e
--- /dev/null
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/PluginExtensionUtilImpl.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2021 Dennis Wagelaar.
+ * 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:
+ * Dennis Wagelaar - initial API and
+ * implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.m2m.atl.emftvm.util;
+
+import java.util.logging.Level;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.m2m.atl.common.ATLLogger;
+import org.eclipse.m2m.atl.emftvm.ModelFactory;
+
+/**
+ * Implementation for {@link PluginExtensionUtil}.
+ *
+ * @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
+ */
+public class PluginExtensionUtilImpl implements PluginExtensionUtil {
+
+ private static final String MODELFACTORY_EXTENSION_POINT = "org.eclipse.m2m.atl.emftvm.modelfactory";
+
+ /**
+ * {@inheritDoc}
+ */
+ public TypeMap<Class<?>, ModelFactory> createModelFactoryRegistry() {
+ final TypeMap<Class<?>, ModelFactory> modelFactoryRegistry = new TypeHashMap<Class<?>, ModelFactory>();
+ if (Platform.isRunning()) {
+ final IExtension[] extensions = Platform.getExtensionRegistry()
+ .getExtensionPoint(MODELFACTORY_EXTENSION_POINT).getExtensions();
+ for (int i = 0; i < extensions.length; i++) {
+ final IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
+ for (int j = 0; j < configElements.length; j++) {
+ final String resourceType = configElements[j].getAttribute("resourceType");
+ if (resourceType != null && resourceType.length() > 0) {
+ try {
+ final Class<?> resourceClass = Class.forName(resourceType);
+ final ModelFactory modelFactory = (ModelFactory) configElements[j]
+ .createExecutableExtension("class");
+ modelFactoryRegistry.put(resourceClass, modelFactory);
+ } catch (final ClassNotFoundException e) {
+ ATLLogger.log(Level.WARNING, "Cannot find specified resourceType", e);
+ } catch (final CoreException e) {
+ ATLLogger.log(Level.WARNING, "Cannot create instance of specified class", e);
+ }
+ }
+ }
+ }
+ }
+ return modelFactoryRegistry;
+ }
+
+}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/WorkspaceUtil.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/WorkspaceUtil.java
index ea507da6..ce715d25 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/WorkspaceUtil.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/WorkspaceUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Dennis Wagelaar.
+ * Copyright (c) 2012, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -13,17 +13,18 @@ package org.eclipse.m2m.atl.emftvm.util;
/**
* Eclipse workspace utility.
- *
+ *
* @author <a href="dwagelaar@gmail.com">Dennis Wagelaar</a>
*/
public interface WorkspaceUtil {
/**
- * Returns the workspace location (absolute path) of <code>path</code> if it is a workspace path, otherwise <code>null</code>.
- *
- * @param path
- * the workspace path
- * @return the workspace location (absolute path) of <code>path</code> or <code>null</code>
+ * Returns the workspace location (absolute path) of <code>path</code> if it is
+ * a workspace path, otherwise <code>null</code>.
+ *
+ * @param path the workspace path
+ * @return the workspace location (absolute path) of <code>path</code> or
+ * <code>null</code>
*/
String getWorkspaceLocation(String path);
diff --git a/plugins/org.eclipse.m2m.atl.sdk-feature/feature.xml b/plugins/org.eclipse.m2m.atl.sdk-feature/feature.xml
index b820c820..d69f1df0 100644
--- a/plugins/org.eclipse.m2m.atl.sdk-feature/feature.xml
+++ b/plugins/org.eclipse.m2m.atl.sdk-feature/feature.xml
@@ -42,6 +42,10 @@
id="org.eclipse.m2m.atl.emftvm"
version="0.0.0"/>
+ <includes
+ id="org.eclipse.m2m.atl.emftvm.cdo"
+ version="0.0.0"/>
+
<plugin
id="org.eclipse.m2m.atl.examples.source"
download-size="0"
diff --git a/releng/org.eclipse.m2m.atl.releng.parent/.settings/org.eclipse.m2e.core.prefs b/releng/org.eclipse.m2m.atl.releng.parent/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 00000000..f897a7f1
--- /dev/null
+++ b/releng/org.eclipse.m2m.atl.releng.parent/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/releng/org.eclipse.m2m.atl.releng.parent/pom.xml b/releng/org.eclipse.m2m.atl.releng.parent/pom.xml
index 7fce3991..98a61d04 100644
--- a/releng/org.eclipse.m2m.atl.releng.parent/pom.xml
+++ b/releng/org.eclipse.m2m.atl.releng.parent/pom.xml
@@ -90,6 +90,8 @@
<module>../../plugins/org.eclipse.m2m.atl.emftvm</module>
<module>../../plugins/org.eclipse.m2m.atl.emftvm-feature</module>
<module>../../plugins/org.eclipse.m2m.atl.emftvm.ant</module>
+ <module>../../plugins/org.eclipse.m2m.atl.emftvm.cdo</module>
+ <module>../../plugins/org.eclipse.m2m.atl.emftvm.cdo-feature</module>
<module>../../plugins/org.eclipse.m2m.atl.emftvm.compiler</module>
<module>../../plugins/org.eclipse.m2m.atl.emftvm.edit</module>
<module>../../plugins/org.eclipse.m2m.atl.emftvm.editor</module>
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/EMFTVMTest.java b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/EMFTVMTest.java
index 2514e337..c3b9cdc2 100644
--- a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/EMFTVMTest.java
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/EMFTVMTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Dennis Wagelaar.
+ * Copyright (c) 2013, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -16,8 +16,6 @@ import java.util.Iterator;
import java.util.SortedSet;
import java.util.logging.Logger;
-import junit.framework.TestCase;
-
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.URI;
@@ -43,9 +41,11 @@ import org.eclipse.m2m.atl.emftvm.util.EMFTVMUtil;
import org.eclipse.m2m.atl.emftvm.util.ModuleResolver;
import org.osgi.framework.Bundle;
+import junit.framework.TestCase;
+
/**
* Abstract unit test base class for EMFTVM.
- *
+ *
* @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
*/
public abstract class EMFTVMTest extends TestCase {
@@ -65,13 +65,13 @@ public abstract class EMFTVMTest extends TestCase {
/**
* Asserts that leftResource and rightResource are equal. Uses EMF Compare.
- *
+ *
* @param leftResource
* the left-hand resource to compare
* @param rightResource
* the right-hand resource to compare
*/
- public static void assertEquals(Resource leftResource, Resource rightResource) {
+ public static void assertEquals(final Resource leftResource, final Resource rightResource) {
final BasicMonitor monitor = new BasicMonitor();
final DefaultComparisonScope scope = new DefaultComparisonScope(leftResource, rightResource, null);
final Comparison match = DefaultMatchEngine.create(UseIdentifiers.NEVER).match(scope, monitor);
@@ -79,7 +79,7 @@ public abstract class EMFTVMTest extends TestCase {
assertFalse("Match model is empty: " + match.getMatches(), match.getMatches().isEmpty());
}
new DefaultDiffEngine(new DiffBuilder()).diff(match, monitor);
- for (Diff diff : match.getDifferences()) {
+ for (final Diff diff : match.getDifferences()) {
// allow only certain kinds of diff elements
if (diff instanceof ReferenceChange && ((ReferenceChange) diff).getKind() == DifferenceKind.CHANGE) {
assertEquals(diff.getMatch().getLeft(), diff.getMatch().getRight(), ((ReferenceChange) diff).getReference());
@@ -91,7 +91,7 @@ public abstract class EMFTVMTest extends TestCase {
/**
* Asserts that <code>left.ref</code> and <code>right.ref</code> point to equal values.
- *
+ *
* @param left
* the left-hand object to compare
* @param right
@@ -106,7 +106,7 @@ public abstract class EMFTVMTest extends TestCase {
final String errorMsg = String.format("Different value found on %s.%s (%s) and %s.%s (%s)",
EMFTVMUtil.toPrettyString(left, null), ref.getName(), EMFTVMUtil.toPrettyString(leftValue, null),
EMFTVMUtil.toPrettyString(right, null), ref.getName(), EMFTVMUtil.toPrettyString(rightValue, null));
-
+
assertEquals(errorMsg, leftValue.size(), rightValue.size());
final Iterator<?> leftVs = leftValue.iterator();
final Iterator<?> rightVs = rightValue.iterator();
@@ -127,7 +127,7 @@ public abstract class EMFTVMTest extends TestCase {
/**
* Asserts that <code>leftValue</code> and <code>rightValue</code> have the same EMF URI.
- *
+ *
* @param errorMsg
* the error message to display on assertion failure
* @param leftValue
@@ -136,15 +136,15 @@ public abstract class EMFTVMTest extends TestCase {
* the right-hand value to compare
*/
private static void assertSameURI(final String errorMsg, final EObject leftValue, final EObject rightValue) {
- assertEquals(errorMsg, leftValue == null ? null : leftValue.eResource().getURI(),
+ assertEquals(errorMsg, leftValue == null ? null : leftValue.eResource().getURI(),
rightValue == null ? null : rightValue.eResource().getURI());
- assertEquals(errorMsg, leftValue == null ? null : leftValue.eResource().getURIFragment(leftValue),
+ assertEquals(errorMsg, leftValue == null ? null : leftValue.eResource().getURIFragment(leftValue),
rightValue == null ? null : rightValue.eResource().getURIFragment(rightValue));
}
/**
* Processes and logs timing statistics.
- *
+ *
* @param prefix
* the log message prefix string
* @param timings
@@ -162,7 +162,7 @@ public abstract class EMFTVMTest extends TestCase {
long max = 0L;
long min = Long.MAX_VALUE;
int i = 0;
- for (long timing : timings) {
+ for (final long timing : timings) {
max = Math.max(max, timing);
min = Math.min(min, timing);
i++;
@@ -182,7 +182,7 @@ public abstract class EMFTVMTest extends TestCase {
long pureMax = 0L;
long pureMin = Long.MAX_VALUE;
i = 0;
- for (long timing : pureTimings) {
+ for (final long timing : pureTimings) {
pureMax = Math.max(pureMax, timing);
pureMin = Math.min(pureMin, timing);
i++;
@@ -199,10 +199,10 @@ public abstract class EMFTVMTest extends TestCase {
final Runtime runtime = Runtime.getRuntime();
LOG.info(String.format(
new StringBuilder("%s\n\tDuration (msec)\tOverall runtime\tPure runtime (without loading)\n")
- .append("\tMinimum time:\t%f\t%f\n").append("\tFirst quartile:\t%f\t%f\n").append("\tMedian time:\t%f\t%f\n")
- .append("\tThird quartile:\t%f\t%f\n").append("\tMaximum time:\t%f\t%f\n")
- .append("\tTransactions per second (median):\t%f\ton\t%d\tthread(s)\n").append("\tHeap space used:\t%d\tMB")
- .toString(), prefix, min / 1E6, pureMin / 1E6, firstQuartile / 1E6, pureFirstQuartile / 1E6, median / 1E6,
+ .append("\tMinimum time:\t%f\t%f\n").append("\tFirst quartile:\t%f\t%f\n").append("\tMedian time:\t%f\t%f\n")
+ .append("\tThird quartile:\t%f\t%f\n").append("\tMaximum time:\t%f\t%f\n")
+ .append("\tTransactions per second (median):\t%f\ton\t%d\tthread(s)\n").append("\tHeap space used:\t%d\tMB")
+ .toString(), prefix, min / 1E6, pureMin / 1E6, firstQuartile / 1E6, pureFirstQuartile / 1E6, median / 1E6,
pureMedian / 1E6, thirdQuartile / 1E6, pureThirdQuartile / 1E6, max / 1E6, pureMax / 1E6, 1E9 * threadCount / median,
threadCount, (runtime.totalMemory() - runtime.freeMemory()) / (1024 * 1024)));
}
@@ -216,17 +216,17 @@ public abstract class EMFTVMTest extends TestCase {
/**
* Creates a new {@link EMFTVMTest}.
- *
+ *
* @param name
* the test name
*/
- public EMFTVMTest(String name) {
+ public EMFTVMTest(final String name) {
super(name);
}
/**
* Loads a {@link Model} instance for the given file name.
- *
+ *
* @param rs
* the {@link ResourceSet} to use for loading
* @param file
@@ -234,14 +234,13 @@ public abstract class EMFTVMTest extends TestCase {
* @return the {@link Model} instance for the given file name
*/
public Model loadTestModel(final ResourceSet rs, final String file) {
- final Model model = EmftvmFactory.eINSTANCE.createModel();
- model.setResource(rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + file, true), true));
- return model;
+ final Resource resource = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + file, true), true);
+ return EmftvmFactory.eINSTANCE.createModel(resource);
}
/**
* Loads a {@link Metamodel} instance for the given file name.
- *
+ *
* @param rs
* the {@link ResourceSet} to use for loading
* @param file
@@ -249,14 +248,13 @@ public abstract class EMFTVMTest extends TestCase {
* @return the {@link Metamodel} instance for the given file name
*/
public Metamodel loadTestMetamodel(final ResourceSet rs, final String file) {
- final Metamodel model = EmftvmFactory.eINSTANCE.createMetamodel();
- model.setResource(rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + file, true), true));
- return model;
+ final Resource resource = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + file, true), true);
+ return EmftvmFactory.eINSTANCE.createMetamodel(resource);
}
/**
* Creates a new {@link Model} instance for the given file name.
- *
+ *
* @param rs
* the {@link ResourceSet} to use for creating
* @param file
@@ -264,14 +262,13 @@ public abstract class EMFTVMTest extends TestCase {
* @return the {@link Model} instance for the given file name
*/
public Model createTestModel(final ResourceSet rs, final String file) {
- final Model model = EmftvmFactory.eINSTANCE.createModel();
- model.setResource(rs.createResource(URI.createPlatformPluginURI(PLUGIN_ID + file, true)));
- return model;
+ final Resource resource = rs.createResource(URI.createPlatformPluginURI(PLUGIN_ID + file, true));
+ return EmftvmFactory.eINSTANCE.createModel(resource);
}
/**
* Creates a new {@link ModuleResolver} for testing. Uses {@value #PLUGIN_URI} + "/test-data/" as module path.
- *
+ *
* @return a new {@link ModuleResolver} for testing
*/
public ModuleResolver createTestModuleResolver() {
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/ExecEnvTest.java b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/ExecEnvTest.java
index 3c71d8bd..75f534a5 100644
--- a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/ExecEnvTest.java
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/ExecEnvTest.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright (c) 2011 Vrije Universiteit Brussel.
+ * Copyright (c) 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -16,8 +17,6 @@ import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
-import junit.textui.TestRunner;
-
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
@@ -56,6 +55,8 @@ import org.eclipse.m2m.atl.emftvm.util.Types;
import org.eclipse.m2m.atl.emftvm.util.VMException;
import org.eclipse.m2m.atl.emftvm.util.VMMonitor;
+import junit.textui.TestRunner;
+
/**
* <!-- begin-user-doc -->
@@ -128,7 +129,7 @@ import org.eclipse.m2m.atl.emftvm.util.VMMonitor;
* @generated NOT
*/
public class ExecEnvTest extends EMFTVMTest {
-
+
private static final Logger LOG = Logger.getLogger(ExecEnvTest.class.getName());
/**
@@ -144,7 +145,7 @@ public class ExecEnvTest extends EMFTVMTest {
* <!-- end-user-doc -->
* @generated
*/
- public static void main(String[] args) {
+ public static void main(final String[] args) {
TestRunner.run(ExecEnvTest.class);
}
@@ -154,7 +155,7 @@ public class ExecEnvTest extends EMFTVMTest {
* <!-- end-user-doc -->
* @generated
*/
- public ExecEnvTest(String name) {
+ public ExecEnvTest(final String name) {
super(name);
}
@@ -164,7 +165,7 @@ public class ExecEnvTest extends EMFTVMTest {
* <!-- end-user-doc -->
* @generated
*/
- protected void setFixture(ExecEnv fixture) {
+ protected void setFixture(final ExecEnv fixture) {
this.fixture = fixture;
}
@@ -342,16 +343,16 @@ public class ExecEnvTest extends EMFTVMTest {
assertEquals(this, env.getMonitor());
terminated = true;
}
- public void step(StackFrame frame) {
+ public void step(final StackFrame frame) {
}
- public void leave(StackFrame frame) {
+ public void leave(final StackFrame frame) {
}
public boolean isTerminated() {
return terminated;
}
- public void error(StackFrame frame, String msg, Exception e) {
+ public void error(final StackFrame frame, final String msg, final Exception e) {
}
- public void enter(StackFrame frame) {
+ public void enter(final StackFrame frame) {
}
};
@@ -359,7 +360,7 @@ public class ExecEnvTest extends EMFTVMTest {
final Module dummyModule = createDummyModule();
// Load module
final ModuleResolver mr = new ModuleResolver() {
- public Module resolveModule(String name) throws ModuleNotFoundException {
+ public Module resolveModule(final String name) throws ModuleNotFoundException {
return dummyModule;
}
};
@@ -385,16 +386,16 @@ public class ExecEnvTest extends EMFTVMTest {
final VMMonitor monitor = new VMMonitor() {
public void terminated() {
}
- public void step(StackFrame frame) {
+ public void step(final StackFrame frame) {
}
- public void leave(StackFrame frame) {
+ public void leave(final StackFrame frame) {
}
public boolean isTerminated() {
return false;
}
- public void error(StackFrame frame, String msg, Exception e) {
+ public void error(final StackFrame frame, final String msg, final Exception e) {
}
- public void enter(StackFrame frame) {
+ public void enter(final StackFrame frame) {
}
};
getFixture().setMonitor(monitor);
@@ -414,8 +415,7 @@ public class ExecEnvTest extends EMFTVMTest {
// Load metamodel
final Resource portsRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/PortsToPins/Ports.ecore", true), true);
- final Metamodel metaModel = EmftvmFactory.eINSTANCE.createMetamodel();
- metaModel.setResource(portsRes);
+ final Metamodel metaModel = EmftvmFactory.eINSTANCE.createMetamodel(portsRes);
env.registerMetaModel("PORTS", metaModel);
assertTrue(env.getMetaModels().containsKey("PORTS"));
@@ -435,8 +435,7 @@ public class ExecEnvTest extends EMFTVMTest {
// Load and register model
final Resource res = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestLib.emftvm", true), true);
- final Model model = EmftvmFactory.eINSTANCE.createModel();
- model.setResource(res);
+ final Model model = EmftvmFactory.eINSTANCE.createModel(res);
env.registerInputModel("M", model);
assertTrue(env.getInputModels().containsKey("M"));
@@ -455,25 +454,23 @@ public class ExecEnvTest extends EMFTVMTest {
final ResourceSet rs = new ResourceSetImpl();
{
- // Load and register model
- final Resource res = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestLib.emftvm", true), true);
- final Model model = EmftvmFactory.eINSTANCE.createModel();
- model.setResource(res);
- env.registerInOutModel("M", model);
+ // Load and register model
+ final Resource res = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestLib.emftvm", true), true);
+ final Model model = EmftvmFactory.eINSTANCE.createModel(res);
+ env.registerInOutModel("M", model);
- assertTrue(env.getInoutModels().containsKey("M"));
- assertEquals(model, env.getInoutModels().get("M"));
+ assertTrue(env.getInoutModels().containsKey("M"));
+ assertEquals(model, env.getInoutModels().get("M"));
}
{
- // Load and register model
- final Resource res = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestLib.emftvm", true), true);
- final Model model = EmftvmFactory.eINSTANCE.createModel();
- model.setResource(res);
- env.registerInOutModel("M", model);
+ // Load and register model
+ final Resource res = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestLib.emftvm", true), true);
+ final Model model = EmftvmFactory.eINSTANCE.createModel(res);
+ env.registerInOutModel("M", model);
- assertTrue(env.getInoutModels().containsKey("M"));
- assertEquals(model, env.getInoutModels().get("M"));
+ assertTrue(env.getInoutModels().containsKey("M"));
+ assertEquals(model, env.getInoutModels().get("M"));
}
}
@@ -490,26 +487,23 @@ public class ExecEnvTest extends EMFTVMTest {
// Load and register input model
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestLib.emftvm", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInputModel("IN", inModel);
assertTrue(env.getInputModels().containsKey("IN"));
assertEquals(inModel, env.getInputModels().get("IN"));
// Load and register in/out model
final Resource inOutRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestLib.emftvm", true), true);
- final Model inOutModel = EmftvmFactory.eINSTANCE.createModel();
- inOutModel.setResource(inOutRes);
+ final Model inOutModel = EmftvmFactory.eINSTANCE.createModel(inOutRes);
env.registerInOutModel("INOUT", inOutModel);
assertTrue(env.getInoutModels().containsKey("INOUT"));
assertEquals(inOutModel, env.getInoutModels().get("INOUT"));
// Create and register output model
final Resource outRes = rs.createResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/out.xmi", true));
- final Model outModel = EmftvmFactory.eINSTANCE.createModel();
- outModel.setResource(outRes);
+ final Model outModel = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerOutputModel("OUT", outModel);
assertTrue(env.getOutputModels().containsKey("OUT"));
assertEquals(outModel, env.getOutputModels().get("OUT"));
-
+
env.clearModels();
assertFalse(env.getInputModels().containsKey("IN"));
assertFalse(env.getInoutModels().containsKey("INOUT"));
@@ -529,8 +523,7 @@ public class ExecEnvTest extends EMFTVMTest {
// Create and register model
final Resource res = rs.createResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/out.xmi", true));
- final Model model = EmftvmFactory.eINSTANCE.createModel();
- model.setResource(res);
+ final Model model = EmftvmFactory.eINSTANCE.createModel(res);
env.registerOutputModel("M", model);
assertTrue(env.getOutputModels().containsKey("M"));
@@ -550,8 +543,7 @@ public class ExecEnvTest extends EMFTVMTest {
// Load metamodel
final Resource portsRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/PortsToPins/Ports.ecore", true), true);
- final Metamodel metaModel = EmftvmFactory.eINSTANCE.createMetamodel();
- metaModel.setResource(portsRes);
+ final Metamodel metaModel = EmftvmFactory.eINSTANCE.createMetamodel(portsRes);
env.registerMetaModel("PORTS", metaModel);
final Metamodel mm = env.getMetaModel(portsRes);
@@ -573,18 +565,17 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestQuery.emftvm", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
-
+
final CodeBlock element = (CodeBlock) inModel.allInstancesOf(EmftvmPackage.eINSTANCE.getCodeBlock()).first();
env.queueForSet(EmftvmPackage.eINSTANCE.getCodeBlock_MaxLocals(), element, 2, new StackFrame(env, EmftvmFactory.eINSTANCE.createCodeBlock()));
-
+
assertFalse(element.getMaxLocals() == 2);
-
+
env.setQueue();
-
+
assertEquals(2, element.getMaxLocals());
}
@@ -601,22 +592,21 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestQuery.emftvm", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
-
+
// Load module with some fields
env.loadModule(new DefaultModuleResolver(PLUGIN_URI + "/test-data/", rs), "TestQuery");
-
+
final Operation element = (Operation) inModel.allInstancesOf(EmftvmPackage.eINSTANCE.getOperation()).first();
final Field field = env.findField(element.eClass(), "testProp");
env.queueForSet(field, element, Boolean.FALSE, new StackFrame(env, EmftvmFactory.eINSTANCE.createCodeBlock()));
-
+
assertNull(field.getValue(element));
-
+
env.setQueue();
-
+
assertEquals(Boolean.FALSE, field.getValue(element));
}
@@ -633,19 +623,18 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/PortsToPins/Ports.ecore", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
-
+
final EObject element = inModel.allInstancesOf(EcorePackage.eINSTANCE.getEClass()).first();
final String xmiID = "_a01";
env.queueXmiIDForSet(element, xmiID, new StackFrame(env, EmftvmFactory.eINSTANCE.createCodeBlock()));
-
+
assertNull(((XMIResource)inRes).getID(element));
-
+
env.setQueue();
-
+
assertEquals(xmiID, ((XMIResource)inRes).getID(element));
}
@@ -662,8 +651,7 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.createResource(URI.createURI("local.xmi"));
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
final CodeBlock element = EmftvmFactory.eINSTANCE.createCodeBlock();
@@ -712,7 +700,7 @@ public class ExecEnvTest extends EMFTVMTest {
try {
env.setQueue();
fail("Expected VMException");
- } catch (VMException e) {
+ } catch (final VMException e) {
// expected
assertTrue(e.getCause() instanceof IndexOutOfBoundsException);
}
@@ -722,7 +710,7 @@ public class ExecEnvTest extends EMFTVMTest {
try {
env.setQueue();
fail("Expected VMException");
- } catch (VMException e) {
+ } catch (final VMException e) {
// expected
assertTrue(e.getCause() instanceof IllegalArgumentException);
}
@@ -732,7 +720,7 @@ public class ExecEnvTest extends EMFTVMTest {
* Tests the '
* {@link org.eclipse.m2m.atl.emftvm.ExecEnv#queueForAdd(org.eclipse.m2m.atl.emftvm.Field, java.lang.Object, java.lang.Object, int, org.eclipse.m2m.atl.emftvm.util.StackFrame)
* <em>Queue For Add</em>}' operation. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @see org.eclipse.m2m.atl.emftvm.ExecEnv#queueForAdd(org.eclipse.m2m.atl.emftvm.Field, java.lang.Object, java.lang.Object, int,
* org.eclipse.m2m.atl.emftvm.util.StackFrame)
* @generated NOT
@@ -745,21 +733,17 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource portsRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/PortsToPins/Ports.ecore", true),
true);
- final Metamodel portsModel = EmftvmFactory.eINSTANCE.createMetamodel();
- portsModel.setResource(portsRes);
+ final Metamodel portsModel = EmftvmFactory.eINSTANCE.createMetamodel(portsRes);
env.registerMetaModel("Ports", portsModel);
final Resource pinsRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/PortsToPins/Pins.ecore", true),
true);
- final Metamodel pinsModel = EmftvmFactory.eINSTANCE.createMetamodel();
- pinsModel.setResource(pinsRes);
+ final Metamodel pinsModel = EmftvmFactory.eINSTANCE.createMetamodel(pinsRes);
env.registerMetaModel("Pins", pinsModel);
final Resource inRes = rs.createResource(URI.createURI("local.xmi"));
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
final Resource outRes = rs.createResource(URI.createURI("local2.xmi"));
- final Model outModel = EmftvmFactory.eINSTANCE.createModel();
- outModel.setResource(outRes);
+ final Model outModel = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerInOutModel("OUT", outModel);
// Load module with some fields
@@ -785,8 +769,7 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestQuery.emftvm", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
// Load module with some fields
@@ -800,7 +783,7 @@ public class ExecEnvTest extends EMFTVMTest {
try {
env.setQueue();
fail("Expected VMException");
- } catch (VMException e) {
+ } catch (final VMException e) {
// expected
assertTrue(e.getCause() instanceof IllegalArgumentException);
// field has been lazily initialised
@@ -829,8 +812,7 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/PortsToPins/Ports.ecore", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
final EObject element = inModel.allInstancesOf(EcorePackage.eINSTANCE.getEClass()).first();
@@ -858,8 +840,7 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.createResource(URI.createURI("local.xmi"));
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
final CodeBlock element = EmftvmFactory.eINSTANCE.createCodeBlock();
@@ -921,21 +902,17 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource portsRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/PortsToPins/Ports.ecore", true),
true);
- final Metamodel portsModel = EmftvmFactory.eINSTANCE.createMetamodel();
- portsModel.setResource(portsRes);
+ final Metamodel portsModel = EmftvmFactory.eINSTANCE.createMetamodel(portsRes);
env.registerMetaModel("Ports", portsModel);
final Resource pinsRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/PortsToPins/Pins.ecore", true),
true);
- final Metamodel pinsModel = EmftvmFactory.eINSTANCE.createMetamodel();
- pinsModel.setResource(pinsRes);
+ final Metamodel pinsModel = EmftvmFactory.eINSTANCE.createMetamodel(pinsRes);
env.registerMetaModel("Pins", pinsModel);
final Resource inRes = rs.createResource(URI.createURI("local.xmi"));
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
final Resource outRes = rs.createResource(URI.createURI("local2.xmi"));
- final Model outModel = EmftvmFactory.eINSTANCE.createModel();
- outModel.setResource(outRes);
+ final Model outModel = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerInOutModel("OUT", outModel);
// Load module with some fields
@@ -968,8 +945,7 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestQuery.emftvm", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
// Load module with some fields
@@ -1007,8 +983,7 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/PortsToPins/Ports.ecore", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
final EObject element = inModel.allInstancesOf(EcorePackage.eINSTANCE.getEClass()).first();
@@ -1048,8 +1023,7 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestQuery.emftvm", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
final CodeBlock element = (CodeBlock) inModel.allInstancesOf(EmftvmPackage.eINSTANCE.getCodeBlock()).first();
@@ -1074,7 +1048,7 @@ public class ExecEnvTest extends EMFTVMTest {
/**
* Tests the '{@link org.eclipse.m2m.atl.emftvm.ExecEnv#remapQueue() <em>Remap Queue</em>}' operation. <!-- begin-user-doc --> <!--
* end-user-doc -->
- *
+ *
* @see org.eclipse.m2m.atl.emftvm.ExecEnv#remapQueue()
* @generated NOT
*/
@@ -1120,7 +1094,7 @@ public class ExecEnvTest extends EMFTVMTest {
try {
env.loadModule(mr, "AbstractTargetClass");
fail("Expected VMException");
- } catch (VMException e) {
+ } catch (final VMException e) {
// Expected
ATLLogger.info(e.getMessage());
}
@@ -1208,13 +1182,13 @@ public class ExecEnvTest extends EMFTVMTest {
final ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
// Create and register operation
- final Operation op = EMFTVMUtil.createOperation(true, "test", Types.EXEC_ENV_TYPE, Types.OCL_ANY_TYPE,
+ final Operation op = EMFTVMUtil.createOperation(true, "test", Types.EXEC_ENV_TYPE, Types.OCL_ANY_TYPE,
new String[][][]{}, new NativeCodeBlock());
final Module module = EmftvmFactory.eINSTANCE.createModule();
module.setName("testmodule");
module.getFeatures().add(op);
env.loadModule(new ModuleResolver() {
- public Module resolveModule(String name) throws ModuleNotFoundException {
+ public Module resolveModule(final String name) throws ModuleNotFoundException {
return module;
}
}, "testmodule");
@@ -1235,13 +1209,13 @@ public class ExecEnvTest extends EMFTVMTest {
final ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
// Create and register operation
- final Operation op = EMFTVMUtil.createOperation(true, "test", Types.EXEC_ENV_TYPE, Types.OCL_ANY_TYPE,
+ final Operation op = EMFTVMUtil.createOperation(true, "test", Types.EXEC_ENV_TYPE, Types.OCL_ANY_TYPE,
new String[][][]{{{"var"}, Types.OCL_ANY_TYPE}}, new NativeCodeBlock());
final Module module = EmftvmFactory.eINSTANCE.createModule();
module.setName("testmodule");
module.getFeatures().add(op);
env.loadModule(new ModuleResolver() {
- public Module resolveModule(String name) throws ModuleNotFoundException {
+ public Module resolveModule(final String name) throws ModuleNotFoundException {
return module;
}
}, "testmodule");
@@ -1287,7 +1261,7 @@ public class ExecEnvTest extends EMFTVMTest {
assertNull(env.findField(EmftvmPackage.eINSTANCE.getExecEnv(), "field"));
env.loadModule(new ModuleResolver() {
- public Module resolveModule(String name) throws ModuleNotFoundException {
+ public Module resolveModule(final String name) throws ModuleNotFoundException {
return m;
}
}, "test");
@@ -1319,7 +1293,7 @@ public class ExecEnvTest extends EMFTVMTest {
assertNull(env.findField(EmftvmPackage.eINSTANCE.getExecEnv(), "field"));
env.loadModule(new ModuleResolver() {
- public Module resolveModule(String name) throws ModuleNotFoundException {
+ public Module resolveModule(final String name) throws ModuleNotFoundException {
return m;
}
}, "test");
@@ -1379,7 +1353,7 @@ public class ExecEnvTest extends EMFTVMTest {
assertNull(env.findField(EmftvmPackage.eINSTANCE.getExecEnv(), "rule"));
env.loadModule(new ModuleResolver() {
- public Module resolveModule(String name) throws ModuleNotFoundException {
+ public Module resolveModule(final String name) throws ModuleNotFoundException {
return m;
}
}, "test");
@@ -1401,7 +1375,7 @@ public class ExecEnvTest extends EMFTVMTest {
try {
final Object type = env.findType("EMFTVM", "ExecEnv");
assertEquals(EmftvmPackage.eINSTANCE.getExecEnv(), type);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
e.printStackTrace();
fail(e.getMessage());
}
@@ -1420,85 +1394,81 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
{
- final Resource inRes = rs.getResource(
- URI.createURI("../../plugins/" + COMPILER_PLUGIN_ID + "/transformations/ATLtoEMFTVM.atl", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
- env.registerInputModel("IN", inModel);
+ final Resource inRes = rs.getResource(
+ URI.createURI("../../plugins/" + COMPILER_PLUGIN_ID + "/transformations/ATLtoEMFTVM.atl", true), true);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
+ env.registerInputModel("IN", inModel);
}
final Resource outRes = rs.createResource(URI.createFileURI("out.xmi"));
- final Model outModel = EmftvmFactory.eINSTANCE.createModel();
- outModel.setResource(outRes);
+ final Model outModel = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerOutputModel("OUT", outModel);
assertEquals(outModel, env.getOutputModels().get("OUT"));
final Resource pbsRes = rs.createResource(URI.createFileURI("pbs.xmi"));
- final Model pbsModel = EmftvmFactory.eINSTANCE.createModel();
- pbsModel.setResource(pbsRes);
+ final Model pbsModel = EmftvmFactory.eINSTANCE.createModel(pbsRes);
env.registerOutputModel("PBS", pbsModel);
assertEquals(pbsModel, env.getOutputModels().get("PBS"));
{
- final Metamodel atlmm = EmftvmFactory.eINSTANCE.createMetamodel();
- atlmm.setResource(rs.getResource(URI.createURI("http://www.eclipse.org/gmt/2005/ATL"), true));
- env.registerMetaModel("ATL", atlmm);
+ final Resource atlres = rs.getResource(URI.createURI("http://www.eclipse.org/gmt/2005/ATL"), true);
+ final Metamodel atlmm = EmftvmFactory.eINSTANCE.createMetamodel(atlres);
+ env.registerMetaModel("ATL", atlmm);
}
{
- final Metamodel pbmm = EmftvmFactory.eINSTANCE.createMetamodel();
- pbmm.setResource(rs.getResource(URI.createPlatformPluginURI(COMMON_PLUGIN_ID + "/model/Problem.ecore", true), true));
- env.registerMetaModel("Problem", pbmm);
+ final Resource pbres = rs
+ .getResource(URI.createPlatformPluginURI(COMMON_PLUGIN_ID + "/model/Problem.ecore", true), true);
+ final Metamodel pbmm = EmftvmFactory.eINSTANCE.createMetamodel(pbres);
+ env.registerMetaModel("Problem", pbmm);
}
// Load and run module
{
- final ModuleResolver mr = new DefaultModuleResolver(COMPILER_PLUGIN_URI + "/transformations/", rs);
- final TimingData td = new TimingData();
- env.loadModule(mr, "ATLtoEMFTVM");
- td.finishLoading();
- env.run(td);
- td.finish();
- LOG.info("ExecEnvText#testRun__TimingData " + td.toString());
+ final ModuleResolver mr = new DefaultModuleResolver(COMPILER_PLUGIN_URI + "/transformations/", rs);
+ final TimingData td = new TimingData();
+ env.loadModule(mr, "ATLtoEMFTVM");
+ td.finishLoading();
+ env.run(td);
+ td.finish();
+ LOG.info("ExecEnvText#testRun__TimingData " + td.toString());
}
// Create another output model, and run the transformation again
final Resource outRes2 = rs.createResource(URI.createFileURI("out2.xmi"));
- final Model outModel2 = EmftvmFactory.eINSTANCE.createModel();
- outModel2.setResource(outRes2);
+ final Model outModel2 = EmftvmFactory.eINSTANCE.createModel(outRes2);
env.registerOutputModel("OUT", outModel2);
assertEquals(outModel2, env.getOutputModels().get("OUT"));
final Resource pbsRes2 = rs.createResource(URI.createFileURI("pbs2.xmi"));
- final Model pbsModel2 = EmftvmFactory.eINSTANCE.createModel();
- pbsModel2.setResource(pbsRes2);
+ final Model pbsModel2 = EmftvmFactory.eINSTANCE.createModel(pbsRes2);
env.registerOutputModel("PBS", pbsModel2);
assertEquals(pbsModel2, env.getOutputModels().get("PBS"));
{
- final TimingData td2 = new TimingData();
- td2.finishLoading();
- env.run(td2);
- td2.finish();
- LOG.info("ExecEnvText#testRun__TimingData 2nd run " + td2.toString());
+ final TimingData td2 = new TimingData();
+ td2.finishLoading();
+ env.run(td2);
+ td2.finish();
+ LOG.info("ExecEnvText#testRun__TimingData 2nd run " + td2.toString());
}
-
+
// Compare results
assertEquals(outRes, outRes2);
assertEquals(pbsRes, pbsRes2);
-
+
// Run once more
outRes2.getContents().clear();
pbsRes2.getContents().clear();
{
- final TimingData td2 = new TimingData();
- td2.finishLoading();
- env.run(td2);
- td2.finish();
- LOG.info("ExecEnvText#testRun__TimingData 3rd run " + td2.toString());
+ final TimingData td2 = new TimingData();
+ td2.finishLoading();
+ env.run(td2);
+ td2.finish();
+ LOG.info("ExecEnvText#testRun__TimingData 3rd run " + td2.toString());
}
-
+
// Compare results
assertEquals(outRes, outRes2);
assertEquals(pbsRes, pbsRes2);
@@ -1507,7 +1477,7 @@ public class ExecEnvTest extends EMFTVMTest {
/**
* Tests the '{@link org.eclipse.m2m.atl.emftvm.ExecEnv#run(org.eclipse.m2m.atl.emftvm.util.TimingData) <em>Run</em>}' operation. <!--
* begin-user-doc --> Refining mode test. <!-- end-user-doc -->
- *
+ *
* @see org.eclipse.m2m.atl.emftvm.ExecEnv#run(org.eclipse.m2m.atl.emftvm.util.TimingData)
* @generated NOT
*/
@@ -1518,19 +1488,16 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(
URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/RefiningModeTest/EMFTVMCopy.trace", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInputModel("IN", inModel);
final Resource inoutRes = rs.getResource(
URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/RefiningModeTest/RefiningModeTest.emftvm", true), true);
- final Model inoutModel = EmftvmFactory.eINSTANCE.createModel();
- inoutModel.setResource(inoutRes);
+ final Model inoutModel = EmftvmFactory.eINSTANCE.createModel(inoutRes);
env.registerInOutModel("INOUT", inoutModel);
final Resource outRes = rs.createResource(URI.createFileURI("RefiningModeTest.ecore"));
- final Model outModel = EmftvmFactory.eINSTANCE.createModel();
- outModel.setResource(outRes);
+ final Model outModel = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerOutputModel("OUT", outModel);
assertEquals(outModel, env.getOutputModels().get("OUT"));
@@ -1559,7 +1526,7 @@ public class ExecEnvTest extends EMFTVMTest {
/**
* Tests the '{@link org.eclipse.m2m.atl.emftvm.ExecEnv#getRules() <em>Get Rules</em>}' operation. <!-- begin-user-doc --> <!--
* end-user-doc -->
- *
+ *
* @see org.eclipse.m2m.atl.emftvm.ExecEnv#getRules()
* @generated NOT
*/
@@ -1576,7 +1543,7 @@ public class ExecEnvTest extends EMFTVMTest {
assertTrue(env.getRules().isEmpty());
env.loadModule(new ModuleResolver() {
- public Module resolveModule(String name) throws ModuleNotFoundException {
+ public Module resolveModule(final String name) throws ModuleNotFoundException {
return m;
}
}, "test");
@@ -1598,22 +1565,20 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestQuery.emftvm", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInputModel("IN", inModel);
final Resource outRes = rs.createResource(URI.createFileURI("out.xmi"));
- final Model outModel = EmftvmFactory.eINSTANCE.createModel();
- outModel.setResource(outRes);
+ final Model outModel = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerOutputModel("OUT", outModel);
-
+
// Get an object, and retrieve its model
final EObject object = inRes.getContents().get(0);
final Model model = env.getModelOf(object);
assertNotNull(model);
assertEquals(inModel, model);
-
+
assertNull(env.getModelOf(env));
}
@@ -1630,15 +1595,13 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestQuery.emftvm", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInputModel("IN", inModel);
final Resource outRes = rs.createResource(URI.createFileURI("out.xmi"));
- final Model outModel = EmftvmFactory.eINSTANCE.createModel();
- outModel.setResource(outRes);
+ final Model outModel = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerOutputModel("OUT", outModel);
-
+
final String modelID = env.getModelID(inModel);
assertNotNull(modelID);
@@ -1658,8 +1621,7 @@ public class ExecEnvTest extends EMFTVMTest {
// Load metamodel
final Resource portsRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/PortsToPins/Ports.ecore", true), true);
- final Metamodel metaModel = EmftvmFactory.eINSTANCE.createMetamodel();
- metaModel.setResource(portsRes);
+ final Metamodel metaModel = EmftvmFactory.eINSTANCE.createMetamodel(portsRes);
env.registerMetaModel("PORTS", metaModel);
final String id = env.getMetaModelID(metaModel);
@@ -1681,22 +1643,21 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inOutRes = rs.createResource(URI.createFileURI("out.xmi"));
- final Model inOutModel = EmftvmFactory.eINSTANCE.createModel();
- inOutModel.setResource(inOutRes);
+ final Model inOutModel = EmftvmFactory.eINSTANCE.createModel(inOutRes);
env.registerInOutModel("INOUT", inOutModel);
-
+
// Create output element
final EObject element = inOutModel.newElement(EmftvmPackage.eINSTANCE.getModule());
-
+
assertFalse(inOutRes.getContents().isEmpty());
assertEquals(element, inOutRes.getContents().get(0));
-
+
env.queueForDelete(element, new StackFrame(env, EmftvmFactory.eINSTANCE.createCodeBlock()));
-
+
assertFalse(inOutRes.getContents().isEmpty());
-
+
env.deleteQueue();
-
+
assertTrue(inOutRes.getContents().isEmpty());
}
@@ -1724,22 +1685,20 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestQuery.emftvm", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInputModel("IN", inModel);
final Resource outRes = rs.createResource(URI.createFileURI("out.xmi"));
- final Model outModel = EmftvmFactory.eINSTANCE.createModel();
- outModel.setResource(outRes);
+ final Model outModel = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerOutputModel("OUT", outModel);
-
+
// Get an object, and retrieve its model
final EObject object = inRes.getContents().get(0);
final Model model = env.getInputModelOf(object);
assertNotNull(model);
assertEquals(inModel, model);
-
+
assertNull(env.getInputModelOf(env));
}
@@ -1756,22 +1715,20 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestQuery.emftvm", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInOutModel("IN", inModel);
final Resource outRes = rs.createResource(URI.createFileURI("out.xmi"));
- final Model outModel = EmftvmFactory.eINSTANCE.createModel();
- outModel.setResource(outRes);
+ final Model outModel = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerOutputModel("OUT", outModel);
-
+
// Get an object, and retrieve its model
final EObject object = inRes.getContents().get(0);
final Model model = env.getInoutModelOf(object);
assertNotNull(model);
assertEquals(inModel, model);
-
+
assertNull(env.getInoutModelOf(env));
}
@@ -1788,22 +1745,20 @@ public class ExecEnvTest extends EMFTVMTest {
// Load models
final Resource inRes = rs.getResource(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/TestQuery.emftvm", true), true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInputModel("IN", inModel);
final Resource outRes = rs.createResource(URI.createFileURI("out.xmi"));
- final Model outModel = EmftvmFactory.eINSTANCE.createModel();
- outModel.setResource(outRes);
+ final Model outModel = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerOutputModel("OUT", outModel);
-
+
// Create output element, and retrieve its model
final EObject element = outModel.newElement(EmftvmPackage.eINSTANCE.getModule());
final Model model = env.getOutputModelOf(element);
assertNotNull(model);
assertEquals(outModel, model);
-
+
assertNull(env.getOutputModelOf(env));
}
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/compiler/CompilerTest.java b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/compiler/CompilerTest.java
index a19ad2f5..218c7975 100644
--- a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/compiler/CompilerTest.java
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/compiler/CompilerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Dennis Wagelaar.
+ * Copyright (c) 2013, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -48,7 +48,7 @@ import org.eclipse.m2m.atl.engine.parser.AtlParser;
/**
* Tests the ATL-to-EMFTVM compiler.
- *
+ *
* @author <a href="dwagelaar@gmail.com">Dennis Wagelaar</a>
*/
public class CompilerTest extends EMFTVMTest {
@@ -95,8 +95,8 @@ public class CompilerTest extends EMFTVMTest {
assertEquals(null, validate(outModel));
final List<EObject> news = outModel.allInstancesOf(EmftvmPackage.eINSTANCE.getNew());
assertFalse(news.isEmpty());
- for (EObject object : news) {
- New new_ = (New) object;
+ for (final EObject object : news) {
+ final New new_ = (New) object;
assertEquals("EXISTING", new_.getModelname());
}
}
@@ -131,9 +131,9 @@ public class CompilerTest extends EMFTVMTest {
final Model refModel = loadTestModel(new ResourceSetImpl(), "/test-data/Regression/Bug425492.emftvm");
assertEquals(refModel.getResource(), outModel.getResource());
}
-
+
/**
- * Tests regression of <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=429745">Bug # 429745</a>:
+ * Tests regression of <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=429745">Bug # 429745</a>:
* EMFTVM compiler crashes on reference to target element in rule "from" clause.
*/
public void testBug429745() {
@@ -144,8 +144,8 @@ public class CompilerTest extends EMFTVMTest {
/**
* Tests detection of character set encoding by the compiler.
- * @throws CoreException
- * @throws IOException
+ * @throws CoreException
+ * @throws IOException
*/
public void testCharEncoding() throws CoreException, IOException {
final IWorkspaceRoot wr = ResourcesPlugin.getWorkspace().getRoot();
@@ -205,7 +205,7 @@ public class CompilerTest extends EMFTVMTest {
/**
* Tests the compilation of a compiler module.
- *
+ *
* @param compilerModule
* the compiler module name
*/
@@ -220,7 +220,7 @@ public class CompilerTest extends EMFTVMTest {
/**
* Compiles the given ATL module.
- *
+ *
* @param moduleURI
* the module URI
* @return the compiled module
@@ -234,32 +234,29 @@ public class CompilerTest extends EMFTVMTest {
// Load models
{
final Resource inRes = rs.getResource(moduleURI, true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInputModel("IN", inModel);
}
final Resource outRes = rs.createResource(URI.createFileURI("out.emftvm"));
- final Model outModel = EmftvmFactory.eINSTANCE.createModel();
- outModel.setResource(outRes);
+ final Model outModel = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerOutputModel("OUT", outModel);
assertEquals(outModel, env.getOutputModels().get("OUT"));
final Resource pbsRes = rs.createResource(URI.createFileURI("pbs.xmi"));
- final Model pbsModel = EmftvmFactory.eINSTANCE.createModel();
- pbsModel.setResource(pbsRes);
+ final Model pbsModel = EmftvmFactory.eINSTANCE.createModel(pbsRes);
env.registerOutputModel("PBS", pbsModel);
assertEquals(pbsModel, env.getOutputModels().get("PBS"));
{
- final Metamodel atlmm = EmftvmFactory.eINSTANCE.createMetamodel();
- atlmm.setResource(rs.getResource(URI.createURI("http://www.eclipse.org/gmt/2005/ATL"), true));
+ final Resource atlres = rs.getResource(URI.createURI("http://www.eclipse.org/gmt/2005/ATL"), true);
+ final Metamodel atlmm = EmftvmFactory.eINSTANCE.createMetamodel(atlres);
env.registerMetaModel("ATL", atlmm);
}
{
- final Metamodel pbmm = EmftvmFactory.eINSTANCE.createMetamodel();
- pbmm.setResource(((EMFReferenceModel) AtlParser.getDefault().getProblemMetamodel()).getResource());
+ final Metamodel pbmm = EmftvmFactory.eINSTANCE
+ .createMetamodel(((EMFReferenceModel) AtlParser.getDefault().getProblemMetamodel()).getResource());
env.registerMetaModel("Problem", pbmm);
}
@@ -289,7 +286,7 @@ public class CompilerTest extends EMFTVMTest {
}
// CodeBlocks passed into a native operation have their parentFrame property set - clear this property:
- for (EObject cb : outModel.allInstancesOf(EmftvmPackage.eINSTANCE.getCodeBlock())) {
+ for (final EObject cb : outModel.allInstancesOf(EmftvmPackage.eINSTANCE.getCodeBlock())) {
((CodeBlock) cb).setParentFrame(null);
}
@@ -298,25 +295,25 @@ public class CompilerTest extends EMFTVMTest {
/**
* Validates the bytecode of <code>module</code>.
- *
+ *
* @param mmodel
* the module model to validate
* @return <code>null</code> if <code>module</code> is valid, otherwise the first invalid object
*/
- protected Object validate(Model mmodel) {
- for (EObject eObject : mmodel.allInstancesOf(EmftvmPackage.eINSTANCE.getCodeBlock())) {
- CodeBlock cb = (CodeBlock) eObject;
+ protected Object validate(final Model mmodel) {
+ for (final EObject eObject : mmodel.allInstancesOf(EmftvmPackage.eINSTANCE.getCodeBlock())) {
+ final CodeBlock cb = (CodeBlock) eObject;
if (!cbStackValidator.validate(cb)) {
return cb;
}
- for (Instruction i : cb.getCode()) {
+ for (final Instruction i : cb.getCode()) {
if (!instrStackValidator.validate(i)) {
return i;
}
}
}
- for (EObject eObject : mmodel.getResource().getContents()) {
- Diagnostic diag = Diagnostician.INSTANCE.validate(eObject);
+ for (final EObject eObject : mmodel.getResource().getContents()) {
+ final Diagnostic diag = Diagnostician.INSTANCE.validate(eObject);
if (diag.getSeverity() != Diagnostic.OK) {
return diag;
}
@@ -326,7 +323,7 @@ public class CompilerTest extends EMFTVMTest {
/**
* Checks the given ATL module against the ATL well-formedness rules.
- *
+ *
* @param moduleURI
* the module URI
* @return the problems model
@@ -338,26 +335,24 @@ public class CompilerTest extends EMFTVMTest {
// Load models
{
final Resource inRes = rs.getResource(moduleURI, true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInputModel("IN", inModel);
}
final Resource pbsRes = rs.createResource(URI.createFileURI("pbs.xmi"));
- final Model pbsModel = EmftvmFactory.eINSTANCE.createModel();
- pbsModel.setResource(pbsRes);
+ final Model pbsModel = EmftvmFactory.eINSTANCE.createModel(pbsRes);
env.registerOutputModel("OUT", pbsModel);
assertEquals(pbsModel, env.getOutputModels().get("OUT"));
{
- final Metamodel atlmm = EmftvmFactory.eINSTANCE.createMetamodel();
- atlmm.setResource(rs.getResource(URI.createURI("http://www.eclipse.org/gmt/2005/ATL"), true));
+ final Resource atlres = rs.getResource(URI.createURI("http://www.eclipse.org/gmt/2005/ATL"), true);
+ final Metamodel atlmm = EmftvmFactory.eINSTANCE.createMetamodel(atlres);
env.registerMetaModel("ATL", atlmm);
}
{
- final Metamodel pbmm = EmftvmFactory.eINSTANCE.createMetamodel();
- pbmm.setResource(((EMFReferenceModel) AtlParser.getDefault().getProblemMetamodel()).getResource());
+ final Metamodel pbmm = EmftvmFactory.eINSTANCE
+ .createMetamodel(((EMFReferenceModel) AtlParser.getDefault().getProblemMetamodel()).getResource());
env.registerMetaModel("Problem", pbmm);
}
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/integration/IntegrationTest.java b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/integration/IntegrationTest.java
index 59b979fa..056bb0c9 100644
--- a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/integration/IntegrationTest.java
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/integration/IntegrationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Dennis Wagelaar.
+ * Copyright (c) 2013, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -122,8 +122,7 @@ public class IntegrationTest extends EMFTVMTest {
public void testBug408391() {
final ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
final TimingData td = new TimingData();
- final Model model = EmftvmFactory.eINSTANCE.createModel();
- model.setResource(EmftvmPackage.eINSTANCE.eResource());
+ final Model model = EmftvmFactory.eINSTANCE.createModel(EmftvmPackage.eINSTANCE.eResource());
env.registerInputModel("IN", model);
env.loadModule(createTestModuleResolver(), "Regression::Bug408391");
td.finishLoading();
@@ -166,8 +165,7 @@ public class IntegrationTest extends EMFTVMTest {
final ResourceSet rs = new ResourceSetImpl();
final ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
final TimingData td = new TimingData();
- final Metamodel metamodel = EmftvmFactory.eINSTANCE.createMetamodel();
- metamodel.setResource(EcorePackage.eINSTANCE.eResource());
+ final Metamodel metamodel = EmftvmFactory.eINSTANCE.createMetamodel(EcorePackage.eINSTANCE.eResource());
final Model model = loadTestModel(rs, "/test-data/EcoreCopy/My.ecore");
env.registerMetaModel("E", metamodel);
env.registerInOutModel("IN", model);
@@ -188,8 +186,7 @@ public class IntegrationTest extends EMFTVMTest {
final ResourceSet rs = new ResourceSetImpl();
final ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
final TimingData td = new TimingData();
- final Metamodel metamodel = EmftvmFactory.eINSTANCE.createMetamodel();
- metamodel.setResource(EcorePackage.eINSTANCE.eResource());
+ final Metamodel metamodel = EmftvmFactory.eINSTANCE.createMetamodel(EcorePackage.eINSTANCE.eResource());
final Model model = loadTestModel(rs, "/test-data/EcoreCopy/My.ecore");
env.registerMetaModel("ECORE", metamodel);
env.registerInOutModel("IN", model);
@@ -210,8 +207,7 @@ public class IntegrationTest extends EMFTVMTest {
final ResourceSet rs = new ResourceSetImpl();
final ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
final TimingData td = new TimingData();
- final Metamodel metamodel = EmftvmFactory.eINSTANCE.createMetamodel();
- metamodel.setResource(EcorePackage.eINSTANCE.eResource());
+ final Metamodel metamodel = EmftvmFactory.eINSTANCE.createMetamodel(EcorePackage.eINSTANCE.eResource());
final Model model = loadTestModel(rs, "/test-data/EcoreCopy/My.ecore");
env.registerMetaModel("ECORE", metamodel);
env.registerInOutModel("IN", model);
@@ -338,10 +334,8 @@ public class IntegrationTest extends EMFTVMTest {
final ResourceSet rs = new ResourceSetImpl();
final ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
final TimingData td = new TimingData();
- final Metamodel tr = EmftvmFactory.eINSTANCE.createMetamodel();
- tr.setResource(TracePackage.eINSTANCE.eResource());
- final Model in = EmftvmFactory.eINSTANCE.createModel();
- in.setResource(EmftvmPackage.eINSTANCE.eResource());
+ final Metamodel tr = EmftvmFactory.eINSTANCE.createMetamodel(TracePackage.eINSTANCE.eResource());
+ final Model in = EmftvmFactory.eINSTANCE.createModel(EmftvmPackage.eINSTANCE.eResource());
final Model trace = createTestModel(rs, "/test-data/Regression/Bug426154/Bug426154.trace");
final Model out = createTestModel(rs, "/test-data/Regression/Bug426154/Bug426154-out.ecore");
env.registerMetaModel("TR", tr);
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/performance/ATLtoEMFTVMPerformanceTest.java b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/performance/ATLtoEMFTVMPerformanceTest.java
index 3c94823f..40e31d90 100644
--- a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/performance/ATLtoEMFTVMPerformanceTest.java
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/performance/ATLtoEMFTVMPerformanceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014 Dennis Wagelaar.
+ * Copyright (c) 2014, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@ import java.util.SortedSet;
import java.util.TreeSet;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.m2m.atl.core.emf.EMFReferenceModel;
@@ -30,7 +31,7 @@ import org.eclipse.m2m.atl.engine.parser.AtlParser;
/**
* EMFTVM performance test suite for <code>EcoreCopy.atl</code>.
- *
+ *
* @author <a href="dwagelaar@gmail.com">Dennis Wagelaar</a>
*/
public class ATLtoEMFTVMPerformanceTest extends PerformanceTest {
@@ -39,7 +40,7 @@ public class ATLtoEMFTVMPerformanceTest extends PerformanceTest {
/**
* Tests EMFTVM performance of <code>ATLtoEMFTVM.atl</code>.
- *
+ *
* @throws IOException
*/
public void testEMFTVM_ATLtoEMFTVM() throws IOException {
@@ -48,7 +49,7 @@ public class ATLtoEMFTVMPerformanceTest extends PerformanceTest {
/**
* Tests EMFTVM performance of <code>ATLtoEMFTVM.atl</code> without JIT.
- *
+ *
* @throws IOException
*/
public void testEMFTVM_NoJIT_ATLtoEMFTVM() throws IOException {
@@ -57,14 +58,14 @@ public class ATLtoEMFTVMPerformanceTest extends PerformanceTest {
/**
* Runs the EMFTVM performance test of <code>ATLtoEMFTVM.atl</code>.
- *
+ *
* @throws IOException
*/
protected void runTestEMFTVM_ATLtoEMFTVM(final String prefix, final boolean jitDisabled) throws IOException {
- final Metamodel atlmm = EmftvmFactory.eINSTANCE.createMetamodel();
- atlmm.setResource(((EMFReferenceModel) AtlParser.getDefault().getAtlMetamodel()).getResource());
- final Metamodel pbmm = EmftvmFactory.eINSTANCE.createMetamodel();
- pbmm.setResource(((EMFReferenceModel) AtlParser.getDefault().getProblemMetamodel()).getResource());
+ final Metamodel atlmm = EmftvmFactory.eINSTANCE
+ .createMetamodel(((EMFReferenceModel) AtlParser.getDefault().getAtlMetamodel()).getResource());
+ final Metamodel pbmm = EmftvmFactory.eINSTANCE
+ .createMetamodel(((EMFReferenceModel) AtlParser.getDefault().getProblemMetamodel()).getResource());
final ExecEnvPool pool = new ExecEnvPool();
pool.setModuleResolverFactory(new DefaultModuleResolverFactory(COMPILER_PLUGIN_URI + "/transformations/"));
@@ -75,12 +76,13 @@ public class ATLtoEMFTVMPerformanceTest extends PerformanceTest {
// JIT warmup
for (int i = 0; i < TEST_COUNT / 10; i++) {
final ResourceSet rs = new ResourceSetImpl();
- final Model in = EmftvmFactory.eINSTANCE.createModel();
- in.setResource(rs.getResource(URI.createPlatformPluginURI(COMPILER_PLUGIN_ID + "/transformations/ATLtoEMFTVM.atl", true), true));
- final Model out = EmftvmFactory.eINSTANCE.createModel();
- out.setResource(rs.createResource(URI.createURI("ATLtoEMFTVM.emftvm")));
- final Model pbsModel = EmftvmFactory.eINSTANCE.createModel();
- pbsModel.setResource(rs.createResource(URI.createFileURI("pbs.xmi")));
+ final Resource inRes = rs.getResource(
+ URI.createPlatformPluginURI(COMPILER_PLUGIN_ID + "/transformations/ATLtoEMFTVM.atl", true), true);
+ final Model in = EmftvmFactory.eINSTANCE.createModel(inRes);
+ final Resource outRes = rs.createResource(URI.createURI("ATLtoEMFTVM.emftvm"));
+ final Model out = EmftvmFactory.eINSTANCE.createModel(outRes);
+ final Resource pbsRes = rs.createResource(URI.createFileURI("pbs.xmi"));
+ final Model pbsModel = EmftvmFactory.eINSTANCE.createModel(pbsRes);
final ExecEnv env = pool.getExecEnv();
env.setJitDisabled(jitDisabled);
@@ -97,12 +99,13 @@ public class ATLtoEMFTVMPerformanceTest extends PerformanceTest {
for (int i = 0; i < TEST_COUNT; i++) {
final TimingData td = new TimingData();
final ResourceSet rs = new ResourceSetImpl();
- final Model in = EmftvmFactory.eINSTANCE.createModel();
- in.setResource(rs.getResource(URI.createPlatformPluginURI(COMPILER_PLUGIN_ID + "/transformations/ATLtoEMFTVM.atl", true), true));
- final Model out = EmftvmFactory.eINSTANCE.createModel();
- out.setResource(rs.createResource(URI.createURI("ATLtoEMFTVM.emftvm")));
- final Model pbsModel = EmftvmFactory.eINSTANCE.createModel();
- pbsModel.setResource(rs.createResource(URI.createFileURI("pbs.xmi")));
+ final Resource inRes = rs.getResource(
+ URI.createPlatformPluginURI(COMPILER_PLUGIN_ID + "/transformations/ATLtoEMFTVM.atl", true), true);
+ final Model in = EmftvmFactory.eINSTANCE.createModel(inRes);
+ final Resource outRes = rs.createResource(URI.createURI("ATLtoEMFTVM.emftvm"));
+ final Model out = EmftvmFactory.eINSTANCE.createModel(outRes);
+ final Resource pbsRes = rs.createResource(URI.createFileURI("pbs.xmi"));
+ final Model pbsModel = EmftvmFactory.eINSTANCE.createModel(pbsRes);
final ExecEnv env = pool.getExecEnv();
env.setJitDisabled(jitDisabled);
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/performance/EcoreCopyPerformanceTest.java b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/performance/EcoreCopyPerformanceTest.java
index 41837b0f..61749cdd 100644
--- a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/performance/EcoreCopyPerformanceTest.java
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/performance/EcoreCopyPerformanceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013-2014 Dennis Wagelaar.
+ * Copyright (c) 2013, 2014, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -45,16 +45,16 @@ import org.eclipse.m2m.atl.emftvm.util.TimingData;
/**
* EMFTVM performance test suite for <code>EcoreCopy.atl</code>.
- *
+ *
* @author <a href="dwagelaar@gmail.com">Dennis Wagelaar</a>
*/
public class EcoreCopyPerformanceTest extends PerformanceTest {
private static final int TEST_COUNT = 500;
-
+
/**
* Tests EMFTVM performance of <code>EcoreCopy.atl</code>.
- *
+ *
* @throws IOException
*/
public void testEMFTVM_EcoreCopy() throws IOException {
@@ -64,7 +64,7 @@ public class EcoreCopyPerformanceTest extends PerformanceTest {
/**
* Tests EMFTVM performance of <code>EcoreCopy.atl</code> without JIT.
- *
+ *
* @throws IOException
*/
public void testEMFTVM_NoJIT_EcoreCopy() throws IOException {
@@ -75,7 +75,7 @@ public class EcoreCopyPerformanceTest extends PerformanceTest {
/**
* Runs the EMFTVM performance test of <code>EcoreCopy.atl</code>.
- *
+ *
* @throws IOException
*/
protected void runTestEMFTVM_EcoreCopy(final ExecEnv env, final String prefix) throws IOException {
@@ -85,10 +85,11 @@ public class EcoreCopyPerformanceTest extends PerformanceTest {
// JIT warmup
for (int i = 0; i < TEST_COUNT / 10; i++) {
final ResourceSet rs = new ResourceSetImpl();
- final Model in = EmftvmFactory.eINSTANCE.createModel();
- in.setResource(rs.getResource(URI.createPlatformPluginURI(EMFTVM_PLUGIN_ID + "/model/emftvm.ecore", true), true));
- final Model out = EmftvmFactory.eINSTANCE.createModel();
- out.setResource(rs.createResource(URI.createURI("out.ecore")));
+ final Resource inRes = rs
+ .getResource(URI.createPlatformPluginURI(EMFTVM_PLUGIN_ID + "/model/emftvm.ecore", true), true);
+ final Model in = EmftvmFactory.eINSTANCE.createModel(inRes);
+ final Resource outRes = rs.createResource(URI.createURI("out.ecore"));
+ final Model out = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerInputModel("IN", in);
env.registerOutputModel("OUT", out);
@@ -101,10 +102,11 @@ public class EcoreCopyPerformanceTest extends PerformanceTest {
for (int i = 0; i < TEST_COUNT; i++) {
final TimingData td = new TimingData();
final ResourceSet rs = new ResourceSetImpl();
- final Model in = EmftvmFactory.eINSTANCE.createModel();
- in.setResource(rs.getResource(URI.createPlatformPluginURI(EMFTVM_PLUGIN_ID + "/model/emftvm.ecore", true), true));
- final Model out = EmftvmFactory.eINSTANCE.createModel();
- out.setResource(rs.createResource(URI.createURI("out.ecore")));
+ final Resource inRes = rs
+ .getResource(URI.createPlatformPluginURI(EMFTVM_PLUGIN_ID + "/model/emftvm.ecore", true), true);
+ final Model in = EmftvmFactory.eINSTANCE.createModel(inRes);
+ final Resource outRes = rs.createResource(URI.createURI("out.ecore"));
+ final Model out = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerInputModel("IN", in);
env.registerOutputModel("OUT", out);
@@ -125,7 +127,7 @@ public class EcoreCopyPerformanceTest extends PerformanceTest {
/**
* Tests EMFVM performance of <code>EcoreCopyASM.atl</code>.
- *
+ *
* @throws ATLCoreException
* @throws IOException
*/
@@ -135,7 +137,7 @@ public class EcoreCopyPerformanceTest extends PerformanceTest {
/**
* Tests Regular VM performance of <code>EcoreCopyASM.atl</code>.
- *
+ *
* @throws ATLCoreException
* @throws IOException
*/
@@ -145,7 +147,7 @@ public class EcoreCopyPerformanceTest extends PerformanceTest {
/**
* Tests Regular VM performance of <code>EcoreCopyASM.atl</code>.
- *
+ *
* @throws ATLCoreException
* @throws IOException
*/
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/pojo/PojoModelTest.java b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/pojo/PojoModelTest.java
index 260253f2..f33e3d8c 100644
--- a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/pojo/PojoModelTest.java
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/pojo/PojoModelTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Dennis Wagelaar.
+ * Copyright (c) 2013, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -37,7 +37,7 @@ import org.eclipse.m2m.atl.emftvm.util.TimingData;
/**
* Tests the <code>pojo.ecore</code> model using {@link Set} and {@link List} for collections instead of {@link EList}.
- *
+ *
* @author <a href="dwagelaar@gmail.com">Dennis Wagelaar</a>
*/
public class PojoModelTest extends EMFTVMTest {
@@ -49,21 +49,20 @@ public class PojoModelTest extends EMFTVMTest {
/**
* {@inheritDoc}
- *
+ *
* @throws Exception
*/
@Override
protected void setUp() throws Exception {
super.setUp();
- pojo = EmftvmFactory.eINSTANCE.createMetamodel();
- pojo.setResource(PojoPackage.eINSTANCE.eResource());
+ pojo = EmftvmFactory.eINSTANCE.createMetamodel(PojoPackage.eINSTANCE.eResource());
moduleResolver = new DefaultModuleResolver(URI.createPlatformPluginURI(PLUGIN_ID + "/test-data/POJOModel/", true).toString(),
new ResourceSetImpl());
}
/**
* Creates a new POJO model.
- *
+ *
* @return a new POJO model
*/
protected Resource createPojoModel() {
@@ -82,7 +81,7 @@ public class PojoModelTest extends EMFTVMTest {
/**
* Creates a new Ecore model.
- *
+ *
* @return a new Ecore model
*/
protected Resource createEcoreModel() {
@@ -100,10 +99,8 @@ public class PojoModelTest extends EMFTVMTest {
* Test method for <code>POJOToEcore.atl</code>.
*/
public void testPOJOToEcore() {
- final Model in = EmftvmFactory.eINSTANCE.createModel();
- in.setResource(createPojoModel());
- final Model out = EmftvmFactory.eINSTANCE.createModel();
- out.setResource(new ResourceImpl(URI.createURI("out.ecore")));
+ final Model in = EmftvmFactory.eINSTANCE.createModel(createPojoModel());
+ final Model out = EmftvmFactory.eINSTANCE.createModel(new ResourceImpl(URI.createURI("out.ecore")));
final ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
env.registerMetaModel("POJO", pojo);
@@ -124,10 +121,8 @@ public class PojoModelTest extends EMFTVMTest {
* Test method for <code>EcoreToPOJO.atl</code>.
*/
public void testEcoreToPOJO() {
- final Model in = EmftvmFactory.eINSTANCE.createModel();
- in.setResource(createEcoreModel());
- final Model out = EmftvmFactory.eINSTANCE.createModel();
- out.setResource(new ResourceImpl(URI.createURI("out.pojo")));
+ final Model in = EmftvmFactory.eINSTANCE.createModel(createEcoreModel());
+ final Model out = EmftvmFactory.eINSTANCE.createModel(new ResourceImpl(URI.createURI("out.pojo")));
final ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
env.registerMetaModel("POJO", pojo);
@@ -160,8 +155,7 @@ public class PojoModelTest extends EMFTVMTest {
* Test method for <code>POJOToPOJO.atl</code>.
*/
public void testPOJOToPOJO() {
- final Model in = EmftvmFactory.eINSTANCE.createModel();
- in.setResource(createPojoModel());
+ final Model in = EmftvmFactory.eINSTANCE.createModel(createPojoModel());
final ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
env.registerMetaModel("POJO", pojo);
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/util/tests/EMFTVMUtilTest.java b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/util/tests/EMFTVMUtilTest.java
index baf51e1f..5ec62998 100644
--- a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/util/tests/EMFTVMUtilTest.java
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/util/tests/EMFTVMUtilTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016-2017 Dennis Wagelaar.
+ * Copyright (c) 2016, 2017, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -353,20 +353,16 @@ public class EMFTVMUtilTest extends TestCase {
final EmftvmFactory ef = EmftvmFactory.eINSTANCE;
final ExecEnv env = ef.createExecEnv();
- final Metamodel metamodel = ef.createMetamodel();
- metamodel.setResource(EcorePackage.eINSTANCE.eResource());
+ final Metamodel metamodel = ef.createMetamodel(EcorePackage.eINSTANCE.eResource());
env.registerMetaModel("ECORE", metamodel);
- final Model inmodel = ef.createModel();
- inmodel.setResource(EmftvmPackage.eINSTANCE.eResource());
+ final Model inmodel = ef.createModel(EmftvmPackage.eINSTANCE.eResource());
env.registerInputModel("IN", inmodel);
- final Model inoutmodel = ef.createModel();
- inoutmodel.setResource(TracePackage.eINSTANCE.eResource());
+ final Model inoutmodel = ef.createModel(TracePackage.eINSTANCE.eResource());
env.registerInOutModel("INOUT", inoutmodel);
- final Model outmodel = ef.createModel();
- outmodel.setResource(EmftvmPackage.eINSTANCE.eResource());
+ final Model outmodel = ef.createModel(EmftvmPackage.eINSTANCE.eResource());
env.registerOutputModel("OUT", outmodel);
final EClass eClass = EcorePackage.eINSTANCE.getEClass();
@@ -384,20 +380,16 @@ public class EMFTVMUtilTest extends TestCase {
final EmftvmFactory ef = EmftvmFactory.eINSTANCE;
final ExecEnv env = ef.createExecEnv();
- final Metamodel metamodel = ef.createMetamodel();
- metamodel.setResource(EcorePackage.eINSTANCE.eResource());
+ final Metamodel metamodel = ef.createMetamodel(EcorePackage.eINSTANCE.eResource());
env.registerMetaModel("ECORE", metamodel);
- final Model inmodel = ef.createModel();
- inmodel.setResource(EmftvmPackage.eINSTANCE.eResource());
+ final Model inmodel = ef.createModel(EmftvmPackage.eINSTANCE.eResource());
env.registerInputModel("IN", inmodel);
- final Model inoutmodel = ef.createModel();
- inoutmodel.setResource(TracePackage.eINSTANCE.eResource());
+ final Model inoutmodel = ef.createModel(TracePackage.eINSTANCE.eResource());
env.registerInOutModel("INOUT", inoutmodel);
- final Model outmodel = ef.createModel();
- outmodel.setResource(EmftvmPackage.eINSTANCE.eResource());
+ final Model outmodel = ef.createModel(EmftvmPackage.eINSTANCE.eResource());
env.registerOutputModel("OUT", outmodel);
final EClass eClass = EcorePackage.eINSTANCE.getEClass();
@@ -414,20 +406,16 @@ public class EMFTVMUtilTest extends TestCase {
final EmftvmFactory ef = EmftvmFactory.eINSTANCE;
final ExecEnv env = ef.createExecEnv();
- final Metamodel metamodel = ef.createMetamodel();
- metamodel.setResource(EcorePackage.eINSTANCE.eResource());
+ final Metamodel metamodel = ef.createMetamodel(EcorePackage.eINSTANCE.eResource());
env.registerMetaModel("ECORE", metamodel);
- final Model inmodel = ef.createModel();
- inmodel.setResource(EmftvmPackage.eINSTANCE.eResource());
+ final Model inmodel = ef.createModel(EmftvmPackage.eINSTANCE.eResource());
env.registerInputModel("IN", inmodel);
- final Model inoutmodel = ef.createModel();
- inoutmodel.setResource(TracePackage.eINSTANCE.eResource());
+ final Model inoutmodel = ef.createModel(TracePackage.eINSTANCE.eResource());
env.registerInOutModel("INOUT", inoutmodel);
- final Model outmodel = ef.createModel();
- outmodel.setResource(EmftvmPackage.eINSTANCE.eResource());
+ final Model outmodel = ef.createModel(EmftvmPackage.eINSTANCE.eResource());
env.registerOutputModel("OUT", outmodel);
final EClass eClass = EcorePackage.eINSTANCE.getEClass();
@@ -444,20 +432,16 @@ public class EMFTVMUtilTest extends TestCase {
final EmftvmFactory ef = EmftvmFactory.eINSTANCE;
final ExecEnv env = ef.createExecEnv();
- final Metamodel metamodel = ef.createMetamodel();
- metamodel.setResource(EcorePackage.eINSTANCE.eResource());
+ final Metamodel metamodel = ef.createMetamodel(EcorePackage.eINSTANCE.eResource());
env.registerMetaModel("ECORE", metamodel);
- final Model inmodel = ef.createModel();
- inmodel.setResource(EmftvmPackage.eINSTANCE.eResource());
+ final Model inmodel = ef.createModel(EmftvmPackage.eINSTANCE.eResource());
env.registerInputModel("IN", inmodel);
- final Model inoutmodel = ef.createModel();
- inoutmodel.setResource(TracePackage.eINSTANCE.eResource());
+ final Model inoutmodel = ef.createModel(TracePackage.eINSTANCE.eResource());
env.registerInOutModel("INOUT", inoutmodel);
- final Model outmodel = ef.createModel();
- outmodel.setResource(EmftvmPackage.eINSTANCE.eResource());
+ final Model outmodel = ef.createModel(EmftvmPackage.eINSTANCE.eResource());
env.registerOutputModel("OUT", outmodel);
final EClass eClass = EcorePackage.eINSTANCE.getEClass();
@@ -478,20 +462,16 @@ public class EMFTVMUtilTest extends TestCase {
final EmftvmFactory ef = EmftvmFactory.eINSTANCE;
final ExecEnv env = ef.createExecEnv();
- final Metamodel metamodel = ef.createMetamodel();
- metamodel.setResource(EcorePackage.eINSTANCE.eResource());
+ final Metamodel metamodel = ef.createMetamodel(EcorePackage.eINSTANCE.eResource());
env.registerMetaModel("ECORE", metamodel);
- final Model inmodel = ef.createModel();
- inmodel.setResource(EmftvmPackage.eINSTANCE.eResource());
+ final Model inmodel = ef.createModel(EmftvmPackage.eINSTANCE.eResource());
env.registerInputModel("IN", inmodel);
- final Model inoutmodel = ef.createModel();
- inoutmodel.setResource(TracePackage.eINSTANCE.eResource());
+ final Model inoutmodel = ef.createModel(TracePackage.eINSTANCE.eResource());
env.registerInOutModel("INOUT", inoutmodel);
- final Model outmodel = ef.createModel();
- outmodel.setResource(EmftvmPackage.eINSTANCE.eResource());
+ final Model outmodel = ef.createModel(EmftvmPackage.eINSTANCE.eResource());
env.registerOutputModel("OUT", outmodel);
final EClass eClass = EcorePackage.eINSTANCE.getEClass();
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/util/tests/ExecEnvPoolTest.java b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/util/tests/ExecEnvPoolTest.java
index b72b088e..995594bd 100644
--- a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/util/tests/ExecEnvPoolTest.java
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/util/tests/ExecEnvPoolTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Dennis Wagelaar.
+ * Copyright (c) 2013, 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -20,6 +20,7 @@ import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.m2m.atl.emftvm.EmftvmFactory;
@@ -35,7 +36,7 @@ import org.eclipse.m2m.atl.emftvm.util.TimingData;
/**
* Tests {@link ExecEnvPool}.
- *
+ *
* @author <a href="dwagelaar@gmail.com">Dennis Wagelaar</a>
*/
public class ExecEnvPoolTest extends EMFTVMTest {
@@ -57,7 +58,7 @@ public class ExecEnvPoolTest extends EMFTVMTest {
try {
pool.registerMetaModel("otherMetamodel", metamodel);
fail("Expected IllegalStateException");
- } catch (IllegalStateException e) {
+ } catch (final IllegalStateException e) {
// expected
}
}
@@ -77,7 +78,7 @@ public class ExecEnvPoolTest extends EMFTVMTest {
try {
pool.loadModule("EcoreCopy");
fail("Expected IllegalStateException");
- } catch (IllegalStateException e) {
+ } catch (final IllegalStateException e) {
// expected
}
}
@@ -109,14 +110,14 @@ public class ExecEnvPoolTest extends EMFTVMTest {
try {
pool.returnExecEnv(EmftvmFactory.eINSTANCE.createExecEnv());
fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// expected
}
}
/**
* Tests the performance of EcoreCopy.emftvm.
- *
+ *
* @throws InterruptedException
*/
public void testEcoreCopyPerformance() throws InterruptedException {
@@ -139,10 +140,11 @@ public class ExecEnvPoolTest extends EMFTVMTest {
final TimingData td = new TimingData();
final ResourceSet rs = new ResourceSetImpl();
- final Model in = EmftvmFactory.eINSTANCE.createModel();
- in.setResource(rs.getResource(URI.createPlatformPluginURI(EMFTVM_PLUGIN_ID + "/model/emftvm.ecore", true), true));
- final Model out = EmftvmFactory.eINSTANCE.createModel();
- out.setResource(rs.createResource(URI.createURI("out.ecore")));
+ final Resource inRes = rs.getResource(
+ URI.createPlatformPluginURI(EMFTVM_PLUGIN_ID + "/model/emftvm.ecore", true), true);
+ final Model in = EmftvmFactory.eINSTANCE.createModel(inRes);
+ final Resource outRes = rs.createResource(URI.createURI("out.ecore"));
+ final Model out = EmftvmFactory.eINSTANCE.createModel(outRes);
assertFalse(env.getInputModels().containsKey("IN"));
assertFalse(env.getOutputModels().containsKey("OUT"));
diff --git a/tests/org.eclipse.m2m.atl.tests/src/org/eclipse/m2m/atl/tests/unit/atlvm/TestNonRegressionEMFTVM.java b/tests/org.eclipse.m2m.atl.tests/src/org/eclipse/m2m/atl/tests/unit/atlvm/TestNonRegressionEMFTVM.java
index a1886da7..6c9f5cf7 100644
--- a/tests/org.eclipse.m2m.atl.tests/src/org/eclipse/m2m/atl/tests/unit/atlvm/TestNonRegressionEMFTVM.java
+++ b/tests/org.eclipse.m2m.atl.tests/src/org/eclipse/m2m/atl/tests/unit/atlvm/TestNonRegressionEMFTVM.java
@@ -1,10 +1,11 @@
/*******************************************************************************
* Copyright (c) 2007, 2012 Obeo.
+ * Copyright (c) 2021 Dennis Wagelaar.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
- *
+ *
* Contributors:
* Obeo - ATL tester
* Dennis Wagelaar
@@ -57,10 +58,11 @@ import org.eclipse.uml2.uml.resource.UMLResource;
/**
* Specifies TestNonRegressionTransfo for the EMFTVM.
- *
+ *
* @author <a href="mailto:william.piers@obeo.fr">William Piers</a>
* @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
*/
+@SuppressWarnings("restriction")
public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
public static final String COMPILER_PLUGIN_ID = "org.eclipse.m2m.atl.emftvm.compiler";
@@ -68,7 +70,7 @@ public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
class CompilingModuleResolver implements ModuleResolver {
- public Module resolveModule(String name) throws ModuleNotFoundException {
+ public Module resolveModule(final String name) throws ModuleNotFoundException {
final URI uri = URI.createURI(name, true);
final Model model = compile(uri);
return (Module) model.getResource().getContents().get(0);
@@ -76,10 +78,8 @@ public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
}
- protected final Metamodel pbmm = EmftvmFactory.eINSTANCE.createMetamodel();
- {
- pbmm.setResource(((EMFReferenceModel) AtlParser.getDefault().getProblemMetamodel()).getResource());
- }
+ protected final Metamodel pbmm = EmftvmFactory.eINSTANCE
+ .createMetamodel(((EMFReferenceModel) AtlParser.getDefault().getProblemMetamodel()).getResource());
/**
* {@inheritDoc}
@@ -93,16 +93,16 @@ public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.m2m.atl.tests.unit.TestNonRegressionTransfo#setUp()
*/
@Override
protected void setUp() throws Exception {
super.setUp();
- Properties properties = new Properties();
+ final Properties properties = new Properties();
properties.load(TestNonRegressionEMFTVM.class.getResourceAsStream("TestNonRegressionEMFTVM.properties")); //$NON-NLS-1$
setProperties(properties);
-
+
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION,
new UMLResourceFactoryImpl());
EPackage.Registry.INSTANCE.put(EcorePackage.eNS_URI, EcorePackage.eINSTANCE);
@@ -110,29 +110,30 @@ public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/uml2/2.0.0/UML", UMLPackage.eINSTANCE); //$NON-NLS-1$
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/uml2/2.1.0/UML", UMLPackage.eINSTANCE); //$NON-NLS-1$
}
-
+
/**
* Launch a transformation.
- *
+ *
* @return pureExecutionTime, i.e. the execution time without loading/saving models
*/
+ @Override
protected double launch() throws ATLCoreException, IOException {
final ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
final ModuleResolver mr = new CompilingModuleResolver();
final ResourceSet rs = new ResourceSetImpl();
// Launch configuration analysis
- URL asmURL = launchParser.getAsmUrl();
- Map<String, String> unsortedSourceModels = launchParser.getInput();
- Map<String, String> unsortedTargetModels = launchParser.getOutput();
- Map<String, String> modelPaths = launchParser.getPath();
- Map<String, URL> libs = launchParser.getLibsFromConfig();
- List<URL> superimps = launchParser.getSuperimpose();
- Map<String, Object> options = launchParser.getOptions();
+ final URL asmURL = launchParser.getAsmUrl();
+ final Map<String, String> unsortedSourceModels = launchParser.getInput();
+ final Map<String, String> unsortedTargetModels = launchParser.getOutput();
+ final Map<String, String> modelPaths = launchParser.getPath();
+ final Map<String, URL> libs = launchParser.getLibsFromConfig();
+ final List<URL> superimps = launchParser.getSuperimpose();
+ final Map<String, Object> options = launchParser.getOptions();
// WARNING only atl2006 compiler refining mode is supported
boolean isRefiningTraceMode = false;
- Object refiningOption = options.get(ATLLaunchConstants.IS_REFINING);
+ final Object refiningOption = options.get(ATLLaunchConstants.IS_REFINING);
if (refiningOption != null) {
isRefiningTraceMode = new Boolean(refiningOption.toString());
}
@@ -141,64 +142,64 @@ public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
fail("Refining trace mode not supported on EMFTVM");
}
- Map<String, String> modelHandlers = launchParser.getModelHandler();
+ final Map<String, String> modelHandlers = launchParser.getModelHandler();
options.put("modelHandlers", modelHandlers); //$NON-NLS-1$
// Metamodels
final Set<String> metamodels = new LinkedHashSet<String>();
metamodels.addAll(unsortedSourceModels.values());
metamodels.addAll(unsortedTargetModels.values());
- for (String metamodel : metamodels) {
+ for (final String metamodel : metamodels) {
loadMetaModel(env, rs, metamodel, modelPaths.get(metamodel));
}
EMFTVMUtil.registerEPackages(rs);
// Libraries
- for (Entry<String, URL> entry : libs.entrySet()) {
+ for (final Entry<String, URL> entry : libs.entrySet()) {
env.loadModule(mr, moduleName(entry.getValue()));
}
env.loadModule(mr, moduleName(asmURL));
// API extensions management
- for (URL url : superimps) {
+ for (final URL url : superimps) {
env.loadModule(mr, moduleName(url));
}
- long startTime = System.currentTimeMillis();
+ final long startTime = System.currentTimeMillis();
// Input models
- for (String key : unsortedSourceModels.keySet()) {
+ for (final String key : unsortedSourceModels.keySet()) {
loadModel(env, rs, key, modelPaths.get(key), false);
}
// Output models
- for (String key : unsortedTargetModels.keySet()) {
+ for (final String key : unsortedTargetModels.keySet()) {
createModel(env, rs, key, modelPaths.get(key), false);
}
try {
env.run(null);
- } catch (VMException e) {
+ } catch (final VMException e) {
fail(asmURL.toString(), e);
}
// Output models
final Map<String, String> saveOptions = new HashMap<String, String>();
saveOptions.put(XMLResource.OPTION_ENCODING, "ISO-8859-1");
- for (Model outModel : env.getOutputModels().values()) {
+ for (final Model outModel : env.getOutputModels().values()) {
outModel.getResource().save(saveOptions);
}
- long endTime = System.currentTimeMillis();
+ final long endTime = System.currentTimeMillis();
return (endTime - startTime) / 1000.;
}
- private static void loadModel(final ExecEnv env, final ResourceSet rs, final String name, final String path, boolean inOut) {
- Model model = EmftvmFactory.eINSTANCE.createModel();
- model.setResource(rs.getResource(uri(path), true));
+ private static void loadModel(final ExecEnv env, final ResourceSet rs, final String name, final String path, final boolean inOut) {
+ final Resource resource = rs.getResource(uri(path), true);
+ final Model model = EmftvmFactory.eINSTANCE.createModel(resource);
if (inOut) {
env.registerInOutModel(name, model);
} else {
@@ -207,18 +208,18 @@ public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
}
private static void loadMetaModel(final ExecEnv env, final ResourceSet rs, final String name, final String path) {
- Metamodel model = EmftvmFactory.eINSTANCE.createMetamodel();
+ final Metamodel model;
if ("#EMF".equals(path)) {
- model.setResource(EcorePackage.eINSTANCE.eResource());
+ model = EmftvmFactory.eINSTANCE.createMetamodel(EcorePackage.eINSTANCE.eResource());
} else {
- model.setResource(rs.getResource(uri(path), true));
+ model = EmftvmFactory.eINSTANCE.createMetamodel(rs.getResource(uri(path), true));
}
env.registerMetaModel(name, model);
}
- private static void createModel(final ExecEnv env, final ResourceSet rs, final String name, final String path, boolean inOut) {
- Model model = EmftvmFactory.eINSTANCE.createModel();
- model.setResource(rs.createResource(uri(path)));
+ private static void createModel(final ExecEnv env, final ResourceSet rs, final String name, final String path, final boolean inOut) {
+ final Resource resource = rs.createResource(uri(path));
+ final Model model = EmftvmFactory.eINSTANCE.createModel(resource);
if (inOut) {
env.registerInOutModel(name, model);
} else {
@@ -238,7 +239,7 @@ public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
/**
* Compiles the given ATL module.
- *
+ *
* @param moduleURI
* the module URI
* @return the compiled module
@@ -253,32 +254,29 @@ public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
// Load models
{
final Resource inRes = rs.getResource(moduleURI, true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInputModel("IN", inModel);
}
final Resource outRes = rs.createResource(URI.createFileURI("out.emftvm"));
- final Model outModel = EmftvmFactory.eINSTANCE.createModel();
- outModel.setResource(outRes);
+ final Model outModel = EmftvmFactory.eINSTANCE.createModel(outRes);
env.registerOutputModel("OUT", outModel);
assertEquals(outModel, env.getOutputModels().get("OUT"));
final Resource pbsRes = rs.createResource(URI.createFileURI("pbs.xmi"));
- final Model pbsModel = EmftvmFactory.eINSTANCE.createModel();
- pbsModel.setResource(pbsRes);
+ final Model pbsModel = EmftvmFactory.eINSTANCE.createModel(pbsRes);
env.registerOutputModel("PBS", pbsModel);
assertEquals(pbsModel, env.getOutputModels().get("PBS"));
{
- final Metamodel atlmm = EmftvmFactory.eINSTANCE.createMetamodel();
- atlmm.setResource(rs.getResource(URI.createURI("http://www.eclipse.org/gmt/2005/ATL"), true));
+ final Resource atlres = rs.getResource(URI.createURI("http://www.eclipse.org/gmt/2005/ATL"), true);
+ final Metamodel atlmm = EmftvmFactory.eINSTANCE.createMetamodel(atlres);
env.registerMetaModel("ATL", atlmm);
}
{
- final Metamodel pbmm = EmftvmFactory.eINSTANCE.createMetamodel();
- pbmm.setResource(((EMFReferenceModel) AtlParser.getDefault().getProblemMetamodel()).getResource());
+ final Resource pbres = ((EMFReferenceModel) AtlParser.getDefault().getProblemMetamodel()).getResource();
+ final Metamodel pbmm = EmftvmFactory.eINSTANCE.createMetamodel(pbres);
env.registerMetaModel("Problem", pbmm);
}
@@ -307,7 +305,7 @@ public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
}
// CodeBlocks passed into a native operation have their parentFrame property set - clear this property:
- for (EObject cb : outModel.allInstancesOf(EmftvmPackage.eINSTANCE.getCodeBlock())) {
+ for (final EObject cb : outModel.allInstancesOf(EmftvmPackage.eINSTANCE.getCodeBlock())) {
((CodeBlock) cb).setParentFrame(null);
}
@@ -316,7 +314,7 @@ public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
/**
* Checks the given ATL module against the ATL well-formedness rules.
- *
+ *
* @param moduleURI
* the module URI
* @return the problems model
@@ -328,20 +326,18 @@ public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
// Load models
{
final Resource inRes = rs.getResource(moduleURI, true);
- final Model inModel = EmftvmFactory.eINSTANCE.createModel();
- inModel.setResource(inRes);
+ final Model inModel = EmftvmFactory.eINSTANCE.createModel(inRes);
env.registerInputModel("IN", inModel);
}
final Resource pbsRes = rs.createResource(URI.createFileURI("pbs.xmi"));
- final Model pbsModel = EmftvmFactory.eINSTANCE.createModel();
- pbsModel.setResource(pbsRes);
+ final Model pbsModel = EmftvmFactory.eINSTANCE.createModel(pbsRes);
env.registerOutputModel("OUT", pbsModel);
assertEquals(pbsModel, env.getOutputModels().get("OUT"));
{
- final Metamodel atlmm = EmftvmFactory.eINSTANCE.createMetamodel();
- atlmm.setResource(rs.getResource(URI.createURI("http://www.eclipse.org/gmt/2005/ATL"), true));
+ final Resource atlres = rs.getResource(URI.createURI("http://www.eclipse.org/gmt/2005/ATL"), true);
+ final Metamodel atlmm = EmftvmFactory.eINSTANCE.createMetamodel(atlres);
env.registerMetaModel("ATL", atlmm);
}
@@ -363,20 +359,20 @@ public class TestNonRegressionEMFTVM extends TestNonRegressionTransfo {
/**
* Retrieves problem elements from <code>problems</code>.
- *
+ *
* @param problems
* the problems model
* @param pbElements
* the collection of problem elements to augment
* @return the number of error problems
*/
- protected int getProblems(Model problems, Collection<EObject> pbElements) {
- final Collection<EObject> pbs = (Collection<EObject>) problems.allInstancesOf((EClass) pbmm.findType("Problem")); //$NON-NLS-1$
+ protected int getProblems(final Model problems, final Collection<EObject> pbElements) {
+ final Collection<EObject> pbs = problems.allInstancesOf((EClass) pbmm.findType("Problem")); //$NON-NLS-1$
int nbErrors = 0;
if (pbs != null) {
- for (EObject pb : pbs) {
- EStructuralFeature severityFeature = pb.eClass().getEStructuralFeature("severity"); //$NON-NLS-1$
+ for (final EObject pb : pbs) {
+ final EStructuralFeature severityFeature = pb.eClass().getEStructuralFeature("severity"); //$NON-NLS-1$
if (severityFeature != null && "error".equals(((Enumerator) pb.eGet(severityFeature)).getName())) { //$NON-NLS-1$
nbErrors++;
}

Back to the top