summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorahaase2008-03-02 17:27:47 (EST)
committer ahaase2008-03-02 17:27:47 (EST)
commit6fb0219c6f92721ba5668cfdef9aabb92a5cf421 (patch)
treef4157b70a45352a8f5544abb0f2f96b81b0a9ace
parent62c122976fed7e6d9fb2b590112043008150ed69 (diff)
downloadorg.eclipse.xpand-6fb0219c6f92721ba5668cfdef9aabb92a5cf421.zip
org.eclipse.xpand-6fb0219c6f92721ba5668cfdef9aabb92a5cf421.tar.gz
org.eclipse.xpand-6fb0219c6f92721ba5668cfdef9aabb92a5cf421.tar.bz2
extensive refactoring to handle functions implemented in Java with a handler via the middle end, just like any other language specific middle end
-rw-r--r--plugins/org.eclipse.xtend.backend/META-INF/MANIFEST.MF7
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipose/xtend/middleend/MiddleEnd.java45
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/FunctionDefContextFactory.java38
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/JavaFunctionClassContributor.java40
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/internal/JavaBuiltinConverterFactory.java1
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/internal/ParameterConverter.java (renamed from plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/ParameterConverter.java)3
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/CollectionOperations.java4
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/ReflectionOperations.java2
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/StringOperations.java4
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/SyslibContributor.java45
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/java/internal/JavaOperation.java2
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/AbstractExecutionContextAware.java (renamed from plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/AbstractExecutionContextAware.java)2
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/ExecutionContextAware.java (renamed from plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/ExecutionContextAware.java)2
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/JavaDefinedFunction.java (renamed from plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/JavaDefinedFunction.java)5
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/JavaFunctionClassContributor.java84
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/M2tHidden.java (renamed from plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/M2tHidden.java)2
-rw-r--r--plugins/org.eclipse.xtend.middleend.xpand/src/org/eclipse/xtend/middleend/xpand/OldXpandRegistry.java5
-rw-r--r--plugins/org.eclipse.xtend.middleend.xpand/src/org/eclipse/xtend/middleend/xpand/XpandBackendFacade.java5
-rw-r--r--plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/OldXtendRegistry.java5
-rw-r--r--plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/XtendBackendFacade.java7
-rw-r--r--plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/OldHelper.java8
-rw-r--r--plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendCollectionOperations.java2
-rw-r--r--plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendGlobalVarOperations.java2
-rw-r--r--plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendLibContributor.java17
-rw-r--r--plugins/org.eclipse.xtend.tests/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/expression/ast/EvaluationTest.java2
-rw-r--r--tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/aop/AopTest.java21
-rw-r--r--tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/ConcatExpressionTest.java7
-rw-r--r--tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/InitClosureExpressionTest.java6
-rw-r--r--tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/SwitchExpressionTest.java6
-rw-r--r--tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/FunctionTest.java8
-rw-r--r--tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/JavaBuiltinConverterTest.java2
-rw-r--r--tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/PolymorphicResolverTest.java4
-rw-r--r--tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/syslib/OverrideTest.java7
-rw-r--r--tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/testhelpers/BackendTestHelper.java9
-rw-r--r--tests/org.eclipse.xtend.middleend.old.test/META-INF/MANIFEST.MF5
-rw-r--r--tests/org.eclipse.xtend.middleend.old.test/src/org/eclipse/xtend/middleend/old/first/FirstAttempt.java6
37 files changed, 218 insertions, 206 deletions
diff --git a/plugins/org.eclipse.xtend.backend/META-INF/MANIFEST.MF b/plugins/org.eclipse.xtend.backend/META-INF/MANIFEST.MF
index 1b43489..fd67501 100644
--- a/plugins/org.eclipse.xtend.backend/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.xtend.backend/META-INF/MANIFEST.MF
@@ -13,7 +13,6 @@ Export-Package: org.eclipose.xtend.middleend,
org.eclipse.xtend.backend.expr;uses:="org.eclipse.xtend.backend.common",
org.eclipse.xtend.backend.functions;uses:="org.eclipse.xtend.backend.common",
org.eclipse.xtend.backend.functions.internal;x-friends:="org.eclipse.xtend.backend.test",
- org.eclipse.xtend.backend.functions.java;uses:="org.eclipse.xtend.backend.iface,org.eclipse.xtend.backend.common",
org.eclipse.xtend.backend.functions.java.internal;x-friends:="org.eclipse.xtend.backend.test",
org.eclipse.xtend.backend.internal;x-internal:=true,
org.eclipse.xtend.backend.syslib,
@@ -22,10 +21,12 @@ Export-Package: org.eclipose.xtend.middleend,
org.eclipse.xtend.backend.types.emf,
org.eclipse.xtend.backend.types.emf.internal;x-internal:=true,
org.eclipse.xtend.backend.types.java.internal;x-internal:=true,
- org.eclipse.xtend.backend.util
+ org.eclipse.xtend.backend.util,
+ org.eclipse.xtend.middleend.javaannotations
Require-Bundle: org.apache.commons.logging,
org.eclipse.emf.ecore,
org.eclipse.osgi,
- org.eclipse.equinox.registry
+ org.eclipse.equinox.registry,
+ org.eclipse.emf.mwe.core
Eclipse-LazyStart: true
Bundle-Activator: org.eclipose.xtend.middleend.internal.Activator
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipose/xtend/middleend/MiddleEnd.java b/plugins/org.eclipse.xtend.backend/src/org/eclipose/xtend/middleend/MiddleEnd.java
index c7ba558..176c2d0 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipose/xtend/middleend/MiddleEnd.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipose/xtend/middleend/MiddleEnd.java
@@ -10,6 +10,7 @@ Contributors:
*/
package org.eclipose.xtend.middleend;
+import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
@@ -20,7 +21,11 @@ import org.eclipse.xtend.backend.aop.AroundAdvice;
import org.eclipse.xtend.backend.common.BackendTypesystem;
import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.common.FunctionDefContext;
-import org.eclipse.xtend.backend.functions.FunctionDefContextFactory;
+import org.eclipse.xtend.backend.common.NamedFunction;
+import org.eclipse.xtend.backend.functions.FunctionDefContextInternal;
+import org.eclipse.xtend.backend.functions.internal.FunctionDefContextImpl;
+import org.eclipse.xtend.backend.syslib.SyslibContributor;
+import org.eclipse.xtend.middleend.javaannotations.JavaFunctionClassContributor;
/**
@@ -42,17 +47,33 @@ public final class MiddleEnd {
private final BackendTypesystem _ts;
/**
+ * this flag marks the temporary state while the syslib is added to a newly created fdc. During
+ * this phase, newly created fdcs are returned *without* registering the syslib to avoid endless
+ * recursion.
+ */
+ private boolean _isInitializingSyslib = false;
+
+ /**
* The map with "specific params" is used to initialize the contributed middle ends.
* The key must be the class implementing the LanguageSpecificMiddleEnd interface
* and contributed via the extension point.
*/
public MiddleEnd (BackendTypesystem ts, List<LanguageSpecificMiddleEnd> languageHandlers) {
- _ctx = BackendFacade.createExecutionContext (new FunctionDefContextFactory (ts).create(), ts, false);
+ if (languageHandlers == null)
+ languageHandlers = new ArrayList<LanguageSpecificMiddleEnd> ();
+
+ // this is a "built-in" handler that is, among other things, necessary for the syslib
+ languageHandlers.add (new JavaFunctionClassContributor ());
+
_ts = ts;
_languageHandlers = languageHandlers;
for (LanguageSpecificMiddleEnd handler: languageHandlers)
handler.setMiddleEnd (this);
+
+ // it is important that the middle end is properly initialized before an fdc is created because
+ // syslib registration relies on an initialized middle end.
+ _ctx = BackendFacade.createExecutionContext (createEmptyFdc(), ts, false);
}
private LanguageSpecificMiddleEnd findHandler (String resourceName) {
@@ -95,4 +116,24 @@ public final class MiddleEnd {
public BackendTypesystem getTypesystem () {
return _ts;
}
+
+ public FunctionDefContextInternal createEmptyFdc () {
+ final FunctionDefContextInternal result = new FunctionDefContextImpl ();
+
+ if (_isInitializingSyslib)
+ return result;
+
+ _isInitializingSyslib = true;
+
+ try {
+ for (String resourceName: SyslibContributor.getSysLibResources())
+ for (NamedFunction f: getFunctions(resourceName).getPublicFunctions())
+ result.register (f, true);
+
+ return result;
+ }
+ finally {
+ _isInitializingSyslib = false;
+ }
+ }
}
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/FunctionDefContextFactory.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/FunctionDefContextFactory.java
deleted file mode 100644
index cba47af..0000000
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/FunctionDefContextFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-Copyright (c) 2008 Arno Haase.
-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:
- Arno Haase - initial API and implementation
- */
-package org.eclipse.xtend.backend.functions;
-
-import org.eclipse.xtend.backend.common.BackendTypesystem;
-import org.eclipse.xtend.backend.common.NamedFunction;
-import org.eclipse.xtend.backend.functions.internal.FunctionDefContextImpl;
-import org.eclipse.xtend.backend.syslib.SyslibContributor;
-
-
-/**
- *
- * @author Arno Haase (http://www.haase-consulting.com)
- */
-public final class FunctionDefContextFactory {
- private final SyslibContributor _syslib;
-
- public FunctionDefContextFactory (BackendTypesystem ts) {
- _syslib = new SyslibContributor (ts);
- }
-
- public FunctionDefContextInternal create () {
- final FunctionDefContextInternal result = new FunctionDefContextImpl ();
-
- for (NamedFunction f: _syslib.getContributedFunctions())
- result.register (f, false);
-
- return result;
- }
-}
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/JavaFunctionClassContributor.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/JavaFunctionClassContributor.java
deleted file mode 100644
index b0349ad..0000000
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/JavaFunctionClassContributor.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-Copyright (c) 2008 Arno Haase.
-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:
- Arno Haase - initial API and implementation
- */
-package org.eclipse.xtend.backend.functions.java;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.xtend.backend.common.BackendTypesystem;
-import org.eclipse.xtend.backend.common.NamedFunction;
-
-
-/**
- * This class contributes no types, but all public methods in a Java class as functions, both static and
- * non-static. Non-static methods share an instance of the providing class *per Contributor instance*.
- * For more global sharing of the instance, Contributor instances must be shared.
- *
- * @author Arno Haase (http://www.haase-consulting.com)
- */
-public final class JavaFunctionClassContributor {
- private final List<NamedFunction> _functions = new ArrayList<NamedFunction>();
-
- public JavaFunctionClassContributor (Class<?> cls, BackendTypesystem ts) {
- for (JavaDefinedFunction f: JavaDefinedFunction.createForEntireClass (cls, ts))
- _functions.add (new NamedFunction (f.getName(), f));
- }
-
- public Collection<NamedFunction> getContributedFunctions () {
- return _functions;
- }
-
-}
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/internal/JavaBuiltinConverterFactory.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/internal/JavaBuiltinConverterFactory.java
index 1a0377d..bcbe2b4 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/internal/JavaBuiltinConverterFactory.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/internal/JavaBuiltinConverterFactory.java
@@ -15,7 +15,6 @@ import java.util.Map;
import org.eclipse.xtend.backend.common.BackendType;
import org.eclipse.xtend.backend.common.EfficientLazyString;
-import org.eclipse.xtend.backend.functions.java.ParameterConverter;
import org.eclipse.xtend.backend.types.builtin.DoubleType;
import org.eclipse.xtend.backend.types.builtin.ListType;
import org.eclipse.xtend.backend.types.builtin.LongType;
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/ParameterConverter.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/internal/ParameterConverter.java
index df32a79..eae0fd1 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/ParameterConverter.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/internal/ParameterConverter.java
@@ -8,9 +8,8 @@ http://www.eclipse.org/legal/epl-v10.html
Contributors:
Arno Haase - initial API and implementation
*/
-package org.eclipse.xtend.backend.functions.java;
+package org.eclipse.xtend.backend.functions.java.internal;
-import org.eclipse.xtend.backend.functions.java.internal.JavaBuiltinConverter;
/**
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/CollectionOperations.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/CollectionOperations.java
index 80db834..9f3ca6a 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/CollectionOperations.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/CollectionOperations.java
@@ -23,8 +23,8 @@ import org.eclipse.xtend.backend.common.BackendType;
import org.eclipse.xtend.backend.common.EfficientLazyString;
import org.eclipse.xtend.backend.common.Function;
import org.eclipse.xtend.backend.common.Helpers;
-import org.eclipse.xtend.backend.functions.java.AbstractExecutionContextAware;
-import org.eclipse.xtend.backend.functions.java.M2tHidden;
+import org.eclipse.xtend.middleend.javaannotations.AbstractExecutionContextAware;
+import org.eclipse.xtend.middleend.javaannotations.M2tHidden;
/**
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/ReflectionOperations.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/ReflectionOperations.java
index 6816916..c090b1a 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/ReflectionOperations.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/ReflectionOperations.java
@@ -17,7 +17,7 @@ import org.eclipse.xtend.backend.common.BackendType;
import org.eclipse.xtend.backend.common.Function;
import org.eclipse.xtend.backend.common.Property;
import org.eclipse.xtend.backend.common.StaticProperty;
-import org.eclipse.xtend.backend.functions.java.AbstractExecutionContextAware;
+import org.eclipse.xtend.middleend.javaannotations.AbstractExecutionContextAware;
/**
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/StringOperations.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/StringOperations.java
index b1a4bab..fba728e 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/StringOperations.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/StringOperations.java
@@ -16,8 +16,8 @@ import java.util.List;
import org.eclipse.xtend.backend.common.EfficientLazyString;
import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.common.Helpers;
-import org.eclipse.xtend.backend.functions.java.AbstractExecutionContextAware;
-import org.eclipse.xtend.backend.functions.java.M2tHidden;
+import org.eclipse.xtend.middleend.javaannotations.AbstractExecutionContextAware;
+import org.eclipse.xtend.middleend.javaannotations.M2tHidden;
/**
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/SyslibContributor.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/SyslibContributor.java
index 48fedea..7894431 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/SyslibContributor.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/syslib/SyslibContributor.java
@@ -10,15 +10,7 @@ Contributors:
*/
package org.eclipse.xtend.backend.syslib;
-import java.io.InputStream;
-import java.util.Collection;
-
-import org.eclipse.xtend.backend.common.BackendTypesystem;
-import org.eclipse.xtend.backend.common.NamedFunction;
-import org.eclipse.xtend.backend.functions.DuplicateAwareNamedFunctionCollection;
-import org.eclipse.xtend.backend.functions.java.JavaFunctionClassContributor;
-import org.eclipse.xtend.backend.util.ErrorHandler;
-import org.eclipse.xtend.backend.util.ResourceToList;
+import static org.eclipse.xtend.middleend.javaannotations.JavaFunctionClassContributor.classAsResource;
/**
@@ -26,34 +18,13 @@ import org.eclipse.xtend.backend.util.ResourceToList;
* @author Arno Haase (http://www.haase-consulting.com)
*/
public final class SyslibContributor {
- public static final String SYSLIB_EXTENSION_RESOURCE = "/xtend.syslib.extensions";
-
- private final DuplicateAwareNamedFunctionCollection _functions = new DuplicateAwareNamedFunctionCollection ();
-
- public SyslibContributor (BackendTypesystem ts) {
- // register built-in functions
- registerExtensionClass (ts, StringOperations.class);
- registerExtensionClass (ts, CollectionOperations.class);
- registerExtensionClass (ts, FileIoOperations.class);
- registerExtensionClass (ts, PrimitiveOperations.class);
-
- // allow external overwriting and extension
- final InputStream in = getClass().getResourceAsStream (SYSLIB_EXTENSION_RESOURCE);
- for (String s: new ResourceToList (in).getResult()) {
- try {
- registerExtensionClass(ts, Class.forName(s));
- } catch (ClassNotFoundException e) {
- ErrorHandler.handle (e);
- }
- }
- }
-
- private void registerExtensionClass (BackendTypesystem ts, Class<?> cls) {
- for (NamedFunction f: new JavaFunctionClassContributor (cls, ts).getContributedFunctions())
- _functions.register (f);
- }
+ private static final String[] _sysLibResources = new String[] {
+ classAsResource (StringOperations.class),
+ classAsResource (CollectionOperations.class),
+ classAsResource (FileIoOperations.class),
+ classAsResource (PrimitiveOperations.class)};
- public Collection<NamedFunction> getContributedFunctions () {
- return _functions.getFunctions();
+ public static String[] getSysLibResources () {
+ return _sysLibResources;
}
}
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/java/internal/JavaOperation.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/java/internal/JavaOperation.java
index 8be81aa..158fe7c 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/java/internal/JavaOperation.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/java/internal/JavaOperation.java
@@ -21,9 +21,9 @@ import org.eclipse.xtend.backend.common.BackendType;
import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.common.ExpressionBase;
import org.eclipse.xtend.backend.common.Function;
-import org.eclipse.xtend.backend.functions.java.ParameterConverter;
import org.eclipse.xtend.backend.functions.java.internal.JavaBuiltinConverter;
import org.eclipse.xtend.backend.functions.java.internal.JavaBuiltinConverterFactory;
+import org.eclipse.xtend.backend.functions.java.internal.ParameterConverter;
import org.eclipse.xtend.backend.util.CollectionHelper;
import org.eclipse.xtend.backend.util.ErrorHandler;
import org.eclipse.xtend.backend.util.StringHelper;
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/AbstractExecutionContextAware.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/AbstractExecutionContextAware.java
index 9abfaa1..8ff34c5 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/AbstractExecutionContextAware.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/AbstractExecutionContextAware.java
@@ -8,7 +8,7 @@ http://www.eclipse.org/legal/epl-v10.html
Contributors:
Arno Haase - initial API and implementation
*/
-package org.eclipse.xtend.backend.functions.java;
+package org.eclipse.xtend.middleend.javaannotations;
import org.eclipse.xtend.backend.common.ExecutionContext;
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/ExecutionContextAware.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/ExecutionContextAware.java
index b73391f..5a72917 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/ExecutionContextAware.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/ExecutionContextAware.java
@@ -8,7 +8,7 @@ http://www.eclipse.org/legal/epl-v10.html
Contributors:
Arno Haase - initial API and implementation
*/
-package org.eclipse.xtend.backend.functions.java;
+package org.eclipse.xtend.middleend.javaannotations;
import org.eclipse.xtend.backend.common.ExecutionContext;
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/JavaDefinedFunction.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/JavaDefinedFunction.java
index 1d5c9c6..8c22e3f 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/JavaDefinedFunction.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/JavaDefinedFunction.java
@@ -8,7 +8,7 @@ http://www.eclipse.org/legal/epl-v10.html
Contributors:
Arno Haase - initial API and implementation
*/
-package org.eclipse.xtend.backend.functions.java;
+package org.eclipse.xtend.middleend.javaannotations;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
@@ -23,6 +23,7 @@ import org.eclipse.xtend.backend.common.ExpressionBase;
import org.eclipse.xtend.backend.common.Function;
import org.eclipse.xtend.backend.functions.java.internal.JavaBuiltinConverter;
import org.eclipse.xtend.backend.functions.java.internal.JavaBuiltinConverterFactory;
+import org.eclipse.xtend.backend.functions.java.internal.ParameterConverter;
import org.eclipse.xtend.backend.util.ErrorHandler;
@@ -46,6 +47,8 @@ public final class JavaDefinedFunction implements Function {
private final JavaBuiltinConverter _returnValueConverter;
+ //TODO move this factory to JavaFunctionClassContributor
+ //TODO separate internal API
/**
* This is a convenience factory method that creates functions for all public methods for an entire class.
*/
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/JavaFunctionClassContributor.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/JavaFunctionClassContributor.java
new file mode 100644
index 0000000..5e1aaa4
--- /dev/null
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/JavaFunctionClassContributor.java
@@ -0,0 +1,84 @@
+/*
+Copyright (c) 2008 Arno Haase.
+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:
+ Arno Haase - initial API and implementation
+ */
+package org.eclipse.xtend.middleend.javaannotations;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipose.xtend.middleend.MiddleEnd;
+import org.eclipose.xtend.middleend.plugins.LanguageSpecificMiddleEnd;
+import org.eclipse.emf.mwe.core.resources.ResourceLoader;
+import org.eclipse.emf.mwe.core.resources.ResourceLoaderFactory;
+import org.eclipse.xtend.backend.aop.AroundAdvice;
+import org.eclipse.xtend.backend.common.FunctionDefContext;
+import org.eclipse.xtend.backend.common.NamedFunction;
+import org.eclipse.xtend.backend.functions.FunctionDefContextInternal;
+
+
+/**
+ * This class contributes no types, but all public methods in a Java class as functions, both static and
+ * non-static. Non-static methods share an instance of the providing class *per Contributor instance*.
+ * For more global sharing of the instance, Contributor instances must be shared.
+ *
+ * @author Arno Haase (http://www.haase-consulting.com)
+ */
+public final class JavaFunctionClassContributor implements LanguageSpecificMiddleEnd {
+ public static final String MIDDLE_END_NAME = "JavaAnnotations";
+
+ private ResourceLoader _resourceLoader = null;
+ private MiddleEnd _middleEnd = null;
+
+ private ResourceLoader getResourceLoader () {
+ if (_resourceLoader == null)
+ _resourceLoader = ResourceLoaderFactory.createResourceLoader();
+
+ return _resourceLoader;
+ }
+
+ public boolean canHandle (String resourceName) {
+ return getCls (resourceName) != null;
+ }
+
+ private Class<?> getCls (String resourceName) {
+ try {
+ return getResourceLoader().loadClass (resourceName.replace('/', '.'));
+ } catch (Throwable e) {
+ return null;
+ }
+ }
+
+ public List<AroundAdvice> getContributedAdvice (String resourceName) {
+ return new ArrayList<AroundAdvice> (); //TODO add support for advice
+ }
+
+ public FunctionDefContext getContributedFunctions (String resourceName) {
+ final FunctionDefContextInternal result = _middleEnd.createEmptyFdc();
+
+ //TODO add support for imported resources
+
+ for (JavaDefinedFunction f: JavaDefinedFunction.createForEntireClass (getCls (resourceName), _middleEnd.getTypesystem()))
+ result.register (new NamedFunction (f.getName(), f), true); //TODO add support for non-public functions
+
+ return result;
+ }
+
+ public String getName () {
+ return MIDDLE_END_NAME;
+ }
+
+ public void setMiddleEnd (MiddleEnd middleEnd) {
+ _middleEnd = middleEnd;
+ }
+
+ public static String classAsResource (Class<?> cls) {
+ return cls.getName().replace('.', '/');
+ }
+}
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/M2tHidden.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/M2tHidden.java
index 167ba6c..8d377c1 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/functions/java/M2tHidden.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/middleend/javaannotations/M2tHidden.java
@@ -8,7 +8,7 @@ http://www.eclipse.org/legal/epl-v10.html
Contributors:
Arno Haase - initial API and implementation
*/
-package org.eclipse.xtend.backend.functions.java;
+package org.eclipse.xtend.middleend.javaannotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
diff --git a/plugins/org.eclipse.xtend.middleend.xpand/src/org/eclipse/xtend/middleend/xpand/OldXpandRegistry.java b/plugins/org.eclipse.xtend.middleend.xpand/src/org/eclipse/xtend/middleend/xpand/OldXpandRegistry.java
index 54b735f..3d746be 100644
--- a/plugins/org.eclipse.xtend.middleend.xpand/src/org/eclipse/xtend/middleend/xpand/OldXpandRegistry.java
+++ b/plugins/org.eclipse.xtend.middleend.xpand/src/org/eclipse/xtend/middleend/xpand/OldXpandRegistry.java
@@ -29,7 +29,6 @@ import org.eclipse.xtend.backend.aop.AroundAdvice;
import org.eclipse.xtend.backend.common.BackendTypesystem;
import org.eclipse.xtend.backend.common.FunctionDefContext;
import org.eclipse.xtend.backend.common.NamedFunction;
-import org.eclipse.xtend.backend.functions.FunctionDefContextFactory;
import org.eclipse.xtend.backend.functions.FunctionDefContextInternal;
import org.eclipse.xtend.backend.util.Cache;
import org.eclipse.xtend.middleend.xpand.internal.OldDefinitionConverter;
@@ -52,7 +51,7 @@ public final class OldXpandRegistry implements LanguageSpecificMiddleEnd {
private final Cache<String, FunctionDefContextInternal> _functionDefContexts = new Cache<String, FunctionDefContextInternal> () {
@Override
protected FunctionDefContextInternal create (String compilationUnit) {
- return new FunctionDefContextFactory (_ts).create();
+ return _middleEnd.createEmptyFdc();
}
};
@@ -104,7 +103,7 @@ public final class OldXpandRegistry implements LanguageSpecificMiddleEnd {
final FunctionDefContextInternal fdc = getFunctionDefContext (xpandFile);
// register the XtendLib. Do this first so the extension can override functions
- for (NamedFunction f: new XtendLibContributor (_ts).getContributedFunctions())
+ for (NamedFunction f: new XtendLibContributor (_middleEnd).getContributedFunctions())
fdc.register (f, false);
final Set<XpandDefinitionName> referenced = new HashSet<XpandDefinitionName> ();
diff --git a/plugins/org.eclipse.xtend.middleend.xpand/src/org/eclipse/xtend/middleend/xpand/XpandBackendFacade.java b/plugins/org.eclipse.xtend.middleend.xpand/src/org/eclipse/xtend/middleend/xpand/XpandBackendFacade.java
index c937875..e0c7462 100644
--- a/plugins/org.eclipse.xtend.middleend.xpand/src/org/eclipse/xtend/middleend/xpand/XpandBackendFacade.java
+++ b/plugins/org.eclipse.xtend.middleend.xpand/src/org/eclipse/xtend/middleend/xpand/XpandBackendFacade.java
@@ -31,7 +31,6 @@ import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.common.ExpressionBase;
import org.eclipse.xtend.backend.common.FunctionDefContext;
import org.eclipse.xtend.backend.common.NamedFunction;
-import org.eclipse.xtend.backend.functions.FunctionDefContextFactory;
import org.eclipse.xtend.backend.functions.FunctionDefContextInternal;
import org.eclipse.xtend.backend.syslib.FileIoOperations;
import org.eclipse.xtend.backend.syslib.FileOutlet;
@@ -129,7 +128,7 @@ public final class XpandBackendFacade {
final OldDefinitionConverter defConverter = new OldDefinitionConverter (ctx, new TypeToBackendType (_middleEnd.getTypesystem(), ctx));
final ExpressionBase converted = defConverter.convertStatementSequence (statements, tpl, referenced);
- final FunctionDefContextInternal fdc = new FunctionDefContextFactory (_middleEnd.getTypesystem()).create();
+ final FunctionDefContextInternal fdc = _middleEnd.createEmptyFdc();
for (XpandDefinitionName xdn: referenced)
for (NamedFunction f: _middleEnd.getFunctions (xdn.getCanonicalTemplateFileName ()).getPublicFunctions())
@@ -285,7 +284,7 @@ public final class XpandBackendFacade {
public FunctionDefContext getFunctionDefContext () {
if (_xpandFile == null)
- return new FunctionDefContextFactory (_middleEnd.getTypesystem()).create();
+ return _middleEnd.createEmptyFdc();
return _middleEnd.getFunctions (_xpandFile);
}
diff --git a/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/OldXtendRegistry.java b/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/OldXtendRegistry.java
index 89d8d98..cc4e0f7 100644
--- a/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/OldXtendRegistry.java
+++ b/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/OldXtendRegistry.java
@@ -29,7 +29,6 @@ import org.eclipse.xtend.backend.aop.AroundAdvice;
import org.eclipse.xtend.backend.common.BackendTypesystem;
import org.eclipse.xtend.backend.common.FunctionDefContext;
import org.eclipse.xtend.backend.common.NamedFunction;
-import org.eclipse.xtend.backend.functions.FunctionDefContextFactory;
import org.eclipse.xtend.backend.functions.FunctionDefContextInternal;
import org.eclipse.xtend.backend.util.Cache;
import org.eclipse.xtend.expression.ExecutionContext;
@@ -56,7 +55,7 @@ public final class OldXtendRegistry implements LanguageSpecificMiddleEnd {
private final Cache<String, FunctionDefContextInternal> _functionDefContexts = new Cache<String, FunctionDefContextInternal> () {
@Override
protected FunctionDefContextInternal create (String compilationUnit) {
- return new FunctionDefContextFactory (_ts).create();
+ return _middleEnd.createEmptyFdc();
}
};
@@ -128,7 +127,7 @@ public final class OldXtendRegistry implements LanguageSpecificMiddleEnd {
final FunctionDefContextInternal fdc = getFunctionDefContext (xtendFile);
// register the XtendLib. Do this first so the extension can override functions
- for (NamedFunction f: new XtendLibContributor (_ts).getContributedFunctions())
+ for (NamedFunction f: new XtendLibContributor (_middleEnd).getContributedFunctions())
fdc.register (f, false);
fdc.register (new CheckConverter (ctx, typeConverter).createCheckFunction(_ts, fdc, extensionFile), false);
diff --git a/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/XtendBackendFacade.java b/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/XtendBackendFacade.java
index 0ab0e7a..4982e9e 100644
--- a/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/XtendBackendFacade.java
+++ b/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/XtendBackendFacade.java
@@ -26,7 +26,6 @@ import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.common.ExpressionBase;
import org.eclipse.xtend.backend.common.FunctionDefContext;
import org.eclipse.xtend.backend.common.NamedFunction;
-import org.eclipse.xtend.backend.functions.FunctionDefContextFactory;
import org.eclipse.xtend.backend.functions.FunctionDefContextInternal;
import org.eclipse.xtend.expression.ExecutionContextImpl;
import org.eclipse.xtend.expression.Variable;
@@ -115,9 +114,9 @@ public final class XtendBackendFacade {
if (_xtendFile != null)
return getFunctionDefContext();
- final FunctionDefContextInternal result = new FunctionDefContextFactory (_middleEnd.getTypesystem()).create();
+ final FunctionDefContextInternal result = _middleEnd.createEmptyFdc();
- for (NamedFunction f: new XtendLibContributor (_middleEnd.getTypesystem()).getContributedFunctions())
+ for (NamedFunction f: new XtendLibContributor (_middleEnd).getContributedFunctions())
result.register (f, false);
return result;
}
@@ -167,7 +166,7 @@ public final class XtendBackendFacade {
public FunctionDefContext getFunctionDefContext () {
if (_xtendFile == null)
- return new FunctionDefContextFactory (_middleEnd.getTypesystem()).create();
+ return _middleEnd.createEmptyFdc();
return _middleEnd.getFunctions (_xtendFile);
}
diff --git a/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/OldHelper.java b/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/OldHelper.java
index 4cf0ded..4cac5b7 100644
--- a/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/OldHelper.java
+++ b/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/OldHelper.java
@@ -59,18 +59,22 @@ public final class OldHelper {
xtendName = xtendName.replace (SyntaxConstants.NS_DELIM, "/");
if (xtendName.endsWith ("." + XtendFile.FILE_EXTENSION))
xtendName = xtendName.substring (0, xtendName.length() - (XtendFile.FILE_EXTENSION.length() + 1));
-
+ if (xtendName.startsWith("/"))
+ xtendName = xtendName.substring (1);
+
return xtendName;
}
public static String normalizeXpandResourceName (String xpandName) {
if (xpandName == null)
return null;
-
+
if (! xpandName.endsWith("." + XpandUtil.TEMPLATE_EXTENSION))
xpandName += "." + XpandUtil.TEMPLATE_EXTENSION;
xpandName = xpandName.replace (SyntaxConstants.NS_DELIM, "/");
+ if (xpandName.startsWith ("/"))
+ xpandName = xpandName.substring (1);
return xpandName;
}
diff --git a/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendCollectionOperations.java b/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendCollectionOperations.java
index 366580d..d563790 100644
--- a/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendCollectionOperations.java
+++ b/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendCollectionOperations.java
@@ -14,8 +14,8 @@ import java.util.Collection;
import org.eclipse.xtend.backend.common.EfficientLazyString;
import org.eclipse.xtend.backend.common.Function;
-import org.eclipse.xtend.backend.functions.java.AbstractExecutionContextAware;
import org.eclipse.xtend.backend.syslib.StringOperations;
+import org.eclipse.xtend.middleend.javaannotations.AbstractExecutionContextAware;
/**
diff --git a/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendGlobalVarOperations.java b/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendGlobalVarOperations.java
index eeef0c0..b0bb2c2 100644
--- a/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendGlobalVarOperations.java
+++ b/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendGlobalVarOperations.java
@@ -4,7 +4,7 @@ import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.eclipse.xtend.backend.functions.java.AbstractExecutionContextAware;
+import org.eclipse.xtend.middleend.javaannotations.AbstractExecutionContextAware;
public class XtendGlobalVarOperations extends AbstractExecutionContextAware {
diff --git a/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendLibContributor.java b/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendLibContributor.java
index 82e7775..48652c0 100644
--- a/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendLibContributor.java
+++ b/plugins/org.eclipse.xtend.middleend.xtend/src/org/eclipse/xtend/middleend/xtend/internal/xtendlib/XtendLibContributor.java
@@ -10,12 +10,13 @@ Contributors:
*/
package org.eclipse.xtend.middleend.xtend.internal.xtendlib;
+import static org.eclipse.xtend.middleend.javaannotations.JavaFunctionClassContributor.classAsResource;
+
import java.util.Collection;
-import org.eclipse.xtend.backend.common.BackendTypesystem;
+import org.eclipose.xtend.middleend.MiddleEnd;
import org.eclipse.xtend.backend.common.NamedFunction;
import org.eclipse.xtend.backend.functions.DuplicateAwareNamedFunctionCollection;
-import org.eclipse.xtend.backend.functions.java.JavaFunctionClassContributor;
/**
@@ -25,14 +26,14 @@ import org.eclipse.xtend.backend.functions.java.JavaFunctionClassContributor;
public class XtendLibContributor {
private final DuplicateAwareNamedFunctionCollection _functions = new DuplicateAwareNamedFunctionCollection ();
- public XtendLibContributor (BackendTypesystem ts) {
- registerExtensionClass (ts, XtendCollectionOperations.class);
- registerExtensionClass (ts, XpandIsDeleteLine.class);
- registerExtensionClass (ts, XtendGlobalVarOperations.class);
+ public XtendLibContributor (MiddleEnd middleEnd) {
+ registerExtensionClass (middleEnd, XtendCollectionOperations.class);
+ registerExtensionClass (middleEnd, XpandIsDeleteLine.class);
+ registerExtensionClass (middleEnd, XtendGlobalVarOperations.class);
}
- private void registerExtensionClass (BackendTypesystem ts, Class<?> cls) {
- for (NamedFunction f: new JavaFunctionClassContributor (cls, ts).getContributedFunctions())
+ private void registerExtensionClass (MiddleEnd middleEnd, Class<?> cls) {
+ for (NamedFunction f: middleEnd.getFunctions (classAsResource (cls)).getPublicFunctions())
_functions.register (f);
}
diff --git a/plugins/org.eclipse.xtend.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.xtend.tests/META-INF/MANIFEST.MF
index 10d15dd..2e266ce 100644
--- a/plugins/org.eclipse.xtend.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.xtend.tests/META-INF/MANIFEST.MF
@@ -24,8 +24,8 @@ Require-Bundle: org.junit,
org.eclipse.xtend,
org.antlr.runtime,
org.eclipse.emf.common,
- org.eclipse.xtend.middleend.old,
org.apache.log4j,
org.apache.commons.logging,
- org.eclipse.xtend.backend
+ org.eclipse.xtend.backend,
+ org.eclipse.xtend.middleend.xtend
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/expression/ast/EvaluationTest.java b/plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/expression/ast/EvaluationTest.java
index 8afeb58..ffd110e 100644
--- a/plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/expression/ast/EvaluationTest.java
+++ b/plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/expression/ast/EvaluationTest.java
@@ -31,7 +31,7 @@ import org.eclipse.xtend.expression.ExecutionContext;
import org.eclipse.xtend.expression.ExecutionContextImpl;
import org.eclipse.xtend.expression.Type1;
import org.eclipse.xtend.expression.Variable;
-import org.eclipse.xtend.middleend.old.XtendBackendFacade;
+import org.eclipse.xtend.middleend.xtend.XtendBackendFacade;
import org.eclipse.xtend.typesystem.Property;
/**
diff --git a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/aop/AopTest.java b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/aop/AopTest.java
index 6d693e1..82e3404 100644
--- a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/aop/AopTest.java
+++ b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/aop/AopTest.java
@@ -10,7 +10,7 @@ Contributors:
*/
package org.eclipse.xtend.backend.aop;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.createEmptyExecutionContext;
+import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.*;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
@@ -28,13 +28,12 @@ import org.eclipse.xtend.backend.common.NamedFunction;
import org.eclipse.xtend.backend.expr.ConcatExpression;
import org.eclipse.xtend.backend.expr.InvocationOnObjectExpression;
import org.eclipse.xtend.backend.expr.LiteralExpression;
-import org.eclipse.xtend.backend.functions.FunctionDefContextFactory;
import org.eclipse.xtend.backend.functions.FunctionDefContextInternal;
-import org.eclipse.xtend.backend.functions.java.JavaDefinedFunction;
import org.eclipse.xtend.backend.testhelpers.CounterFunction;
import org.eclipse.xtend.backend.types.builtin.CollectionType;
import org.eclipse.xtend.backend.types.builtin.ObjectType;
import org.eclipse.xtend.backend.util.Pair;
+import org.eclipse.xtend.middleend.javaannotations.JavaDefinedFunction;
import org.junit.Test;
@@ -47,7 +46,7 @@ public class AopTest {
public void testUncached () {
final ExecutionContext ctx = createEmptyExecutionContext();
- final FunctionDefContextInternal fdc = new FunctionDefContextFactory (ctx.getTypesystem()).create();
+ final FunctionDefContextInternal fdc = createEmptyFdc (ctx.getTypesystem());
ctx.setFunctionDefContext (fdc);
for (JavaDefinedFunction f: JavaDefinedFunction.createForEntireClass (CounterFunction.class, ctx.getTypesystem()))
@@ -78,7 +77,7 @@ public class AopTest {
}
private void registerAdvice (ExecutionContext ctx, String prefix, String postfix, boolean proceed, Pointcut pointCut, boolean cached) {
- ctx.setAdviceContext (ctx.getAdviceContext().copyWithAdvice (new AroundAdvice (ConcatAdviceFactory.createConcatExpression (prefix, postfix, proceed), pointCut, cached, createEmptyFdc (ctx))));
+ ctx.setAdviceContext (ctx.getAdviceContext().copyWithAdvice (new AroundAdvice (ConcatAdviceFactory.createConcatExpression (prefix, postfix, proceed), pointCut, cached, createEmptyFdc (ctx.getTypesystem()))));
}
@SuppressWarnings("unchecked")
@@ -86,7 +85,7 @@ public class AopTest {
public void testVarArgsParamTypeMatching () {
final ExecutionContext ctx = createEmptyExecutionContext();
- final FunctionDefContextInternal fdc = new FunctionDefContextFactory (ctx.getTypesystem()).create();
+ final FunctionDefContextInternal fdc = createEmptyFdc (ctx.getTypesystem());
ctx.setFunctionDefContext (fdc);
for (JavaDefinedFunction f: JavaDefinedFunction.createForEntireClass (AopTestFunctions.class, ctx.getTypesystem()))
@@ -113,7 +112,7 @@ public class AopTest {
public void testExplicitParamTypeMatching () {
final ExecutionContext ctx = createEmptyExecutionContext();
- final FunctionDefContextInternal fdc = new FunctionDefContextFactory (ctx.getTypesystem()).create();
+ final FunctionDefContextInternal fdc = createEmptyFdc (ctx.getTypesystem());
ctx.setFunctionDefContext (fdc);
for (JavaDefinedFunction f: JavaDefinedFunction.createForEntireClass (AopTestFunctions.class, ctx.getTypesystem()))
@@ -140,7 +139,7 @@ public class AopTest {
public void testNameMatching () {
final ExecutionContext ctx = createEmptyExecutionContext();
- final FunctionDefContextInternal fdc = new FunctionDefContextFactory (ctx.getTypesystem()).create();
+ final FunctionDefContextInternal fdc = createEmptyFdc (ctx.getTypesystem());
ctx.setFunctionDefContext (fdc);
for (JavaDefinedFunction f: JavaDefinedFunction.createForEntireClass (AopTestFunctions.class, ctx.getTypesystem()))
@@ -181,7 +180,7 @@ public class AopTest {
final ExecutionContext ctx = createEmptyExecutionContext();
- final FunctionDefContextInternal fdc = new FunctionDefContextFactory (ctx.getTypesystem()).create();
+ final FunctionDefContextInternal fdc = createEmptyFdc (ctx.getTypesystem());
ctx.setFunctionDefContext (fdc);
for (JavaDefinedFunction f: JavaDefinedFunction.createForEntireClass (CounterFunction.class, ctx.getTypesystem()))
@@ -228,10 +227,6 @@ public class AopTest {
ctx.setAdviceContext (ctx.getAdviceContext().copyWithAdvice (new AroundAdvice (new ConcatExpression (toBeConcatenated, null), pointCut, cacheable, ctx.getFunctionDefContext())));
}
-
- private FunctionDefContextInternal createEmptyFdc (ExecutionContext ctx) {
- return new FunctionDefContextFactory (ctx.getTypesystem()).create();
- }
}
diff --git a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/ConcatExpressionTest.java b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/ConcatExpressionTest.java
index c644781..5d9f4ff 100644
--- a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/ConcatExpressionTest.java
+++ b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/ConcatExpressionTest.java
@@ -10,9 +10,7 @@ Contributors:
*/
package org.eclipse.xtend.backend.expr;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.SOURCE_POS;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.createEmptyExecutionContext;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.createLiteral;
+import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.*;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
@@ -21,7 +19,6 @@ import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.common.ExpressionBase;
import org.eclipse.xtend.backend.common.Helpers;
import org.eclipse.xtend.backend.common.NamedFunction;
-import org.eclipse.xtend.backend.functions.FunctionDefContextFactory;
import org.eclipse.xtend.backend.functions.FunctionDefContextInternal;
import org.eclipse.xtend.backend.testhelpers.NamedFunctionFactory;
import org.eclipse.xtend.backend.types.CompositeTypesystem;
@@ -55,7 +52,7 @@ public class ConcatExpressionTest {
}
}.create();
- final FunctionDefContextInternal fdc = new FunctionDefContextFactory (new CompositeTypesystem ()).create();
+ final FunctionDefContextInternal fdc = createEmptyFdc (new CompositeTypesystem ());
fdc.register (myToString, true);
final ExpressionBase expr = new ConcatExpression (Arrays.asList (createLiteral("a"), createLiteral("b")), SOURCE_POS);
diff --git a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/InitClosureExpressionTest.java b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/InitClosureExpressionTest.java
index 8ac3442..bf435cf 100644
--- a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/InitClosureExpressionTest.java
+++ b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/InitClosureExpressionTest.java
@@ -10,8 +10,7 @@ Contributors:
*/
package org.eclipse.xtend.backend.expr;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.SOURCE_POS;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.createEmptyExecutionContext;
+import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.*;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
@@ -25,7 +24,6 @@ import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.common.ExpressionBase;
import org.eclipse.xtend.backend.common.Function;
import org.eclipse.xtend.backend.common.NamedFunction;
-import org.eclipse.xtend.backend.functions.FunctionDefContextFactory;
import org.eclipse.xtend.backend.functions.FunctionDefContextInternal;
import org.eclipse.xtend.backend.types.CompositeTypesystem;
import org.eclipse.xtend.backend.types.builtin.StringType;
@@ -78,7 +76,7 @@ public class InitClosureExpressionTest {
@Test public void testFdcPropagation () {
final BackendTypesystem ts = new CompositeTypesystem ();
- final FunctionDefContextInternal fdc = new FunctionDefContextFactory (ts).create();
+ final FunctionDefContextInternal fdc = createEmptyFdc (ts);
fdc.register (new NamedFunction ("myFunction", new Function () {
public ExpressionBase getGuard () {
diff --git a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/SwitchExpressionTest.java b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/SwitchExpressionTest.java
index b9a0ad2..a999738 100644
--- a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/SwitchExpressionTest.java
+++ b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/expr/SwitchExpressionTest.java
@@ -10,8 +10,7 @@ Contributors:
*/
package org.eclipse.xtend.backend.expr;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.SOURCE_POS;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.createEmptyExecutionContext;
+import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.*;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
@@ -20,7 +19,6 @@ import java.util.List;
import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.common.ExpressionBase;
import org.eclipse.xtend.backend.common.NamedFunction;
-import org.eclipse.xtend.backend.functions.FunctionDefContextFactory;
import org.eclipse.xtend.backend.functions.FunctionDefContextInternal;
import org.eclipse.xtend.backend.testhelpers.CheckEvaluationExpression;
import org.eclipse.xtend.backend.testhelpers.NamedFunctionFactory;
@@ -110,7 +108,7 @@ public class SwitchExpressionTest {
}
}.create();
- final FunctionDefContextInternal fdc = new FunctionDefContextFactory (new CompositeTypesystem ()).create();
+ final FunctionDefContextInternal fdc = createEmptyFdc (new CompositeTypesystem ());
fdc.register (myStringEquals, true);
final ExecutionContext ctx = createEmptyExecutionContext();
diff --git a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/FunctionTest.java b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/FunctionTest.java
index a90ae33..5d6ab75 100644
--- a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/FunctionTest.java
+++ b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/FunctionTest.java
@@ -10,7 +10,7 @@ Contributors:
*/
package org.eclipse.xtend.backend.functions;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.createEmptyExecutionContext;
+import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.*;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
@@ -18,9 +18,9 @@ import java.util.ArrayList;
import org.eclipse.xtend.backend.common.EfficientLazyString;
import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.common.NamedFunction;
-import org.eclipse.xtend.backend.functions.java.JavaDefinedFunction;
import org.eclipse.xtend.backend.testhelpers.CounterFunction;
import org.eclipse.xtend.backend.testhelpers.NamedFunctionFactory;
+import org.eclipse.xtend.middleend.javaannotations.JavaDefinedFunction;
import org.junit.Test;
@@ -32,7 +32,7 @@ public class FunctionTest {
@Test public void testCachedAndSingleInstance () {
final ExecutionContext ctx = createEmptyExecutionContext ();
- final FunctionDefContextInternal fdc = new FunctionDefContextFactory (ctx.getTypesystem()).create();
+ final FunctionDefContextInternal fdc = createEmptyFdc (ctx.getTypesystem());
ctx.setFunctionDefContext (fdc);
for (JavaDefinedFunction f: JavaDefinedFunction.createForEntireClass (CounterFunction.class, ctx.getTypesystem()))
@@ -62,7 +62,7 @@ public class FunctionTest {
@Test public void testImmutableCachedStringResult () {
final ExecutionContext ctx = createEmptyExecutionContext ();
- final FunctionDefContextInternal fdc = new FunctionDefContextFactory (ctx.getTypesystem()).create();
+ final FunctionDefContextInternal fdc = createEmptyFdc (ctx.getTypesystem());
ctx.setFunctionDefContext (fdc);
fdc.register (new NamedFunctionFactory ("myCached", true) {
diff --git a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/JavaBuiltinConverterTest.java b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/JavaBuiltinConverterTest.java
index f43df6b..fea759b 100644
--- a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/JavaBuiltinConverterTest.java
+++ b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/JavaBuiltinConverterTest.java
@@ -17,9 +17,9 @@ import java.util.Arrays;
import java.util.List;
import org.eclipse.xtend.backend.common.EfficientLazyString;
-import org.eclipse.xtend.backend.functions.java.ParameterConverter;
import org.eclipse.xtend.backend.functions.java.internal.IntConverter;
import org.eclipse.xtend.backend.functions.java.internal.JavaBuiltinConverterFactory;
+import org.eclipse.xtend.backend.functions.java.internal.ParameterConverter;
import org.eclipse.xtend.backend.types.builtin.DoubleType;
import org.eclipse.xtend.backend.types.builtin.ListType;
import org.eclipse.xtend.backend.types.builtin.LongType;
diff --git a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/PolymorphicResolverTest.java b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/PolymorphicResolverTest.java
index 4746e33..4d86f86 100644
--- a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/PolymorphicResolverTest.java
+++ b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/functions/PolymorphicResolverTest.java
@@ -10,7 +10,7 @@ Contributors:
*/
package org.eclipse.xtend.backend.functions;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.createEmptyExecutionContext;
+import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.*;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
@@ -46,7 +46,7 @@ public class PolymorphicResolverTest {
}
private Collection<Function> getCandidates (Object... params) {
- final FunctionDefContextImpl fdc = (FunctionDefContextImpl) new FunctionDefContextFactory (new CompositeTypesystem ()).create();
+ final FunctionDefContextImpl fdc = (FunctionDefContextImpl) createEmptyFdc (new CompositeTypesystem ());
return new PolymorphicResolver ("operatorPlus").getBestFitCandidates (fdc.findFunctionCandidates (createEmptyExecutionContext(), "operatorPlus", Arrays.asList (params)));
}
diff --git a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/syslib/OverrideTest.java b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/syslib/OverrideTest.java
index e70288b..15026e3 100644
--- a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/syslib/OverrideTest.java
+++ b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/syslib/OverrideTest.java
@@ -10,9 +10,7 @@ Contributors:
*/
package org.eclipse.xtend.backend.syslib;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.SOURCE_POS;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.createEmptyExecutionContext;
-import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.createLiteral;
+import static org.eclipse.xtend.backend.testhelpers.BackendTestHelper.*;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
@@ -21,7 +19,6 @@ import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.common.ExpressionBase;
import org.eclipse.xtend.backend.common.NamedFunction;
import org.eclipse.xtend.backend.expr.ConcatExpression;
-import org.eclipse.xtend.backend.functions.FunctionDefContextFactory;
import org.eclipse.xtend.backend.functions.FunctionDefContextInternal;
import org.eclipse.xtend.backend.testhelpers.NamedFunctionFactory;
import org.eclipse.xtend.backend.types.CompositeTypesystem;
@@ -53,7 +50,7 @@ public class OverrideTest {
final ExpressionBase expr = new ConcatExpression (Arrays.asList (createLiteral (25L), createLiteral ("Abc")), SOURCE_POS);
- final FunctionDefContextInternal fdc = new FunctionDefContextFactory (new CompositeTypesystem ()).create();
+ final FunctionDefContextInternal fdc = createEmptyFdc (new CompositeTypesystem ());
fdc.register (myLongToString, true);
fdc.register (myObjectToString, true);
diff --git a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/testhelpers/BackendTestHelper.java b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/testhelpers/BackendTestHelper.java
index d89e281..08581da 100644
--- a/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/testhelpers/BackendTestHelper.java
+++ b/tests/org.eclipse.xtend.backend.test/src/org/eclipse/xtend/backend/testhelpers/BackendTestHelper.java
@@ -10,13 +10,14 @@ Contributors:
*/
package org.eclipse.xtend.backend.testhelpers;
+import org.eclipose.xtend.middleend.MiddleEnd;
import org.eclipse.xtend.backend.BackendFacade;
import org.eclipse.xtend.backend.common.BackendTypesystem;
import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.common.ExpressionBase;
import org.eclipse.xtend.backend.common.SourcePos;
import org.eclipse.xtend.backend.expr.LiteralExpression;
-import org.eclipse.xtend.backend.functions.FunctionDefContextFactory;
+import org.eclipse.xtend.backend.functions.FunctionDefContextInternal;
import org.eclipse.xtend.backend.types.CompositeTypesystem;
@@ -33,9 +34,13 @@ public class BackendTestHelper {
*/
public static ExecutionContext createEmptyExecutionContext () {
final BackendTypesystem ts = new CompositeTypesystem ();
- return BackendFacade.createExecutionContext (new FunctionDefContextFactory (ts).create(), ts, true);
+ return BackendFacade.createExecutionContext (new MiddleEnd (ts, null).createEmptyFdc(), ts, true);
}
+ public static FunctionDefContextInternal createEmptyFdc (BackendTypesystem ts) {
+ return new MiddleEnd (ts, null).createEmptyFdc();
+ }
+
public static ExpressionBase createLiteral (Object literal) {
return new LiteralExpression (literal, SOURCE_POS);
}
diff --git a/tests/org.eclipse.xtend.middleend.old.test/META-INF/MANIFEST.MF b/tests/org.eclipse.xtend.middleend.old.test/META-INF/MANIFEST.MF
index 8054ef9..e014dcb 100644
--- a/tests/org.eclipse.xtend.middleend.old.test/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.xtend.middleend.old.test/META-INF/MANIFEST.MF
@@ -4,9 +4,10 @@ Bundle-Name: Test Plug-in
Bundle-SymbolicName: org.eclipse.xtend.middleend.old.test
Bundle-Version: 1.0.0
Require-Bundle: org.eclipse.xtend.backend,
- org.eclipse.xtend.middleend.old,
org.eclipse.xtend,
org.eclipse.xpand,
org.eclipse.emf.mwe.core,
org.apache.commons.logging,
- org.junit4
+ org.junit4,
+ org.eclipse.xtend.middleend.xpand,
+ org.eclipse.xtend.middleend.xtend
diff --git a/tests/org.eclipse.xtend.middleend.old.test/src/org/eclipse/xtend/middleend/old/first/FirstAttempt.java b/tests/org.eclipse.xtend.middleend.old.test/src/org/eclipse/xtend/middleend/old/first/FirstAttempt.java
index f06d101..53696fe 100644
--- a/tests/org.eclipse.xtend.middleend.old.test/src/org/eclipse/xtend/middleend/old/first/FirstAttempt.java
+++ b/tests/org.eclipse.xtend.middleend.old.test/src/org/eclipse/xtend/middleend/old/first/FirstAttempt.java
@@ -22,9 +22,9 @@ import org.eclipse.xpand2.output.Outlet;
import org.eclipse.xtend.backend.BackendFacade;
import org.eclipse.xtend.backend.common.ExecutionContext;
import org.eclipse.xtend.backend.types.CompositeTypesystem;
-import org.eclipse.xtend.middleend.old.XpandBackendFacade;
-import org.eclipse.xtend.middleend.old.XpandComponent;
-import org.eclipse.xtend.middleend.old.XtendBackendFacade;
+import org.eclipse.xtend.middleend.xpand.XpandBackendFacade;
+import org.eclipse.xtend.middleend.xpand.XpandComponent;
+import org.eclipse.xtend.middleend.xtend.XtendBackendFacade;
import org.eclipse.xtend.typesystem.MetaModel;
import org.junit.Test;