summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Zarnekow2013-10-02 04:25:20 (EDT)
committerSebastian Zarnekow2013-10-02 04:40:08 (EDT)
commit1d7dddcc5577937c388d6552569d96fa42e6f4ed (patch)
tree8edb43db7375b7f800fd38cd839db43f25397e5d
parentdc8397aade33df9aa25431c5f88fdf54a9410205 (diff)
downloadorg.eclipse.emf-1d7dddcc5577937c388d6552569d96fa42e6f4ed.zip
org.eclipse.emf-1d7dddcc5577937c388d6552569d96fa42e6f4ed.tar.gz
org.eclipse.emf-1d7dddcc5577937c388d6552569d96fa42e6f4ed.tar.bz2
Fixed failing test (annotation is a reserved word)refs/changes/52/16952/1
Also: Regenerated with latest Xtend Signed-off-by: Sebastian Zarnekow <Sebastian.Zarnekow@itemis.de>
-rw-r--r--plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/XcoreExtensions.java6
-rw-r--r--plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/formatting/XcoreFormatter.java336
-rw-r--r--plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/util/XcoreGenModelBuilder.java62
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/interpreter/XcoreInterpreterXbaseIntegrationTest.java8
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/xtend-gen/org/eclipse/emf/test/ecore/xcore/mapping/XcoreMapperTest.java32
5 files changed, 219 insertions, 225 deletions
diff --git a/plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/XcoreExtensions.java b/plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/XcoreExtensions.java
index 4f5d271..4c2b665 100644
--- a/plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/XcoreExtensions.java
+++ b/plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/XcoreExtensions.java
@@ -25,9 +25,8 @@ public class XcoreExtensions {
boolean _matched = false;
if (!_matched) {
if (t instanceof GenClass) {
- final GenClass _genClass = (GenClass)t;
_matched=true;
- _switchResult = _genClass;
+ _switchResult = ((GenClass)t);
}
}
if (!_matched) {
@@ -43,9 +42,8 @@ public class XcoreExtensions {
boolean _matched = false;
if (!_matched) {
if (t instanceof GenTypeParameter) {
- final GenTypeParameter _genTypeParameter = (GenTypeParameter)t;
_matched=true;
- _switchResult = _genTypeParameter;
+ _switchResult = ((GenTypeParameter)t);
}
}
if (!_matched) {
diff --git a/plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/formatting/XcoreFormatter.java b/plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/formatting/XcoreFormatter.java
index 062db45..8a7e8fb 100644
--- a/plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/formatting/XcoreFormatter.java
+++ b/plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/formatting/XcoreFormatter.java
@@ -92,40 +92,40 @@ public class XcoreFormatter extends XbaseFormatter2 {
protected void _format(final XAnnotation xAnnotation, final FormattableDocument format) {
ILeafNode _nodeForKeyword = this._nodeModelAccess.nodeForKeyword(xAnnotation, "@");
final Procedure1<FormattingDataInit> _function = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append = this._formattingDataFactory.append(_nodeForKeyword, _function);
format.operator_add(_append);
final ILeafNode leftParenthesis = this._nodeModelAccess.nodeForKeyword(xAnnotation, "(");
final Procedure1<FormattingDataInit> _function_1 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend = this._formattingDataFactory.prepend(leftParenthesis, _function_1);
format.operator_add(_prepend);
final Procedure1<FormattingDataInit> _function_2 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append_1 = this._formattingDataFactory.append(leftParenthesis, _function_2);
format.operator_add(_append_1);
final ILeafNode rightParenthesis = this._nodeModelAccess.nodeForKeyword(xAnnotation, ")");
final Procedure1<FormattingDataInit> _function_3 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_1 = this._formattingDataFactory.prepend(rightParenthesis, _function_3);
format.operator_add(_prepend_1);
final Procedure1<FormattingDataInit> _function_4 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.newLine();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.newLine();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append_2 = this._formattingDataFactory.append(rightParenthesis, _function_4);
format.operator_add(_append_2);
EMap<String,String> _details = xAnnotation.getDetails();
@@ -134,17 +134,17 @@ public class XcoreFormatter extends XbaseFormatter2 {
final EObject detail = ((EObject) entry);
final ILeafNode equals = this._nodeModelAccess.nodeForKeyword(detail, "=");
final Procedure1<FormattingDataInit> _function_5 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_2 = this._formattingDataFactory.prepend(equals, _function_5);
format.operator_add(_prepend_2);
final Procedure1<FormattingDataInit> _function_6 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append_3 = this._formattingDataFactory.append(equals, _function_6);
format.operator_add(_append_3);
INode _nodeForEObject = this._nodeModelAccess.nodeForEObject(detail);
@@ -152,10 +152,10 @@ public class XcoreFormatter extends XbaseFormatter2 {
boolean _notEquals = (!Objects.equal(comma, null));
if (_notEquals) {
final Procedure1<FormattingDataInit> _function_7 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_3 = this._formattingDataFactory.prepend(comma, _function_7);
format.operator_add(_prepend_3);
}
@@ -168,18 +168,18 @@ public class XcoreFormatter extends XbaseFormatter2 {
this.formatAnnotations(_annotations, format);
INode _nodeForEObject = this._nodeModelAccess.nodeForEObject(xPackage);
final Procedure1<FormattingDataInit> _function = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend = this._formattingDataFactory.prepend(_nodeForEObject, _function);
format.operator_add(_prepend);
INode _nodeForFeature = this._nodeModelAccess.nodeForFeature(xPackage, Literals.XNAMED_ELEMENT__NAME);
final Procedure1<FormattingDataInit> _function_1 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.oneSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.oneSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_1 = this._formattingDataFactory.prepend(_nodeForFeature, _function_1);
format.operator_add(_prepend_1);
final EList<XImportDirective> xImportDirectives = xPackage.getImportDirectives();
@@ -194,10 +194,10 @@ public class XcoreFormatter extends XbaseFormatter2 {
boolean _equals = Objects.equal(xImportDirective, first);
if (_equals) {
final Procedure1<FormattingDataInit> _function_2 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.cfg(XcoreFormatter.this.blankLines);
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.cfg(XcoreFormatter.this.blankLines);
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_2 = this._formattingDataFactory.prepend(node, _function_2);
format.operator_add(_prepend_2);
}
@@ -205,18 +205,18 @@ public class XcoreFormatter extends XbaseFormatter2 {
boolean _equals_1 = Objects.equal(xImportDirective, last);
if (_equals_1) {
final Procedure1<FormattingDataInit> _function_3 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.cfg(XcoreFormatter.this.blankLines);
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.cfg(XcoreFormatter.this.blankLines);
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append = this._formattingDataFactory.append(node, _function_3);
format.operator_add(_append);
} else {
final Procedure1<FormattingDataInit> _function_4 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.newLine();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.newLine();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append_1 = this._formattingDataFactory.append(node, _function_4);
format.operator_add(_append_1);
}
@@ -225,10 +225,10 @@ public class XcoreFormatter extends XbaseFormatter2 {
} else {
INode _nodeForFeature_1 = this._nodeModelAccess.nodeForFeature(xPackage, Literals.XNAMED_ELEMENT__NAME);
final Procedure1<FormattingDataInit> _function_2 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.cfg(XcoreFormatter.this.blankLines);
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.cfg(XcoreFormatter.this.blankLines);
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append = this._formattingDataFactory.append(_nodeForFeature_1, _function_2);
format.operator_add(_append);
}
@@ -241,10 +241,10 @@ public class XcoreFormatter extends XbaseFormatter2 {
if (_notEquals) {
INode _nodeForEObject_1 = this._nodeModelAccess.nodeForEObject(xClassifier);
final Procedure1<FormattingDataInit> _function_3 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.cfg(XcoreFormatter.this.blankLines);
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.cfg(XcoreFormatter.this.blankLines);
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append_1 = this._formattingDataFactory.append(_nodeForEObject_1, _function_3);
format.operator_add(_append_1);
}
@@ -257,17 +257,17 @@ public class XcoreFormatter extends XbaseFormatter2 {
this.formatAnnotations(_annotations, format);
final ILeafNode leftBrace = this._nodeModelAccess.nodeForKeyword(xEnum, "{");
final Procedure1<FormattingDataInit> _function = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.increaseIndentation();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.increaseIndentation();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append = this._formattingDataFactory.append(leftBrace, _function);
format.operator_add(_append);
final Procedure1<FormattingDataInit> _function_1 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.newLine();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.newLine();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append_1 = this._formattingDataFactory.append(leftBrace, _function_1);
format.operator_add(_append_1);
EList<XEnumLiteral> _literals = xEnum.getLiterals();
@@ -276,20 +276,20 @@ public class XcoreFormatter extends XbaseFormatter2 {
this.format(xEnumLiteral, format);
INode _nodeForEObject = this._nodeModelAccess.nodeForEObject(xEnumLiteral);
final Procedure1<FormattingDataInit> _function_2 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.newLine();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.newLine();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append_2 = this._formattingDataFactory.append(_nodeForEObject, _function_2);
format.operator_add(_append_2);
}
}
final ILeafNode rightBrace = this._nodeModelAccess.nodeForKeyword(xEnum, "}");
final Procedure1<FormattingDataInit> _function_2 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.decreaseIndentation();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.decreaseIndentation();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend = this._formattingDataFactory.prepend(rightBrace, _function_2);
format.operator_add(_prepend);
}
@@ -304,27 +304,27 @@ public class XcoreFormatter extends XbaseFormatter2 {
boolean _notEquals = (!Objects.equal(leftAngleBracket, null));
if (_notEquals) {
final Procedure1<FormattingDataInit> _function = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend = this._formattingDataFactory.prepend(leftAngleBracket, _function);
format.operator_add(_prepend);
final Procedure1<FormattingDataInit> _function_1 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append = this._formattingDataFactory.append(leftAngleBracket, _function_1);
format.operator_add(_append);
EList<XTypeParameter> _typeParameters = xDataType.getTypeParameters();
this.formatTypeParameters(_typeParameters, format);
ILeafNode _nodeForKeyword = this._nodeModelAccess.nodeForKeyword(xDataType, ">");
final Procedure1<FormattingDataInit> _function_2 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_1 = this._formattingDataFactory.prepend(_nodeForKeyword, _function_2);
format.operator_add(_prepend_1);
}
@@ -337,43 +337,43 @@ public class XcoreFormatter extends XbaseFormatter2 {
boolean _notEquals = (!Objects.equal(leftAngleBracket, null));
if (_notEquals) {
final Procedure1<FormattingDataInit> _function = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend = this._formattingDataFactory.prepend(leftAngleBracket, _function);
format.operator_add(_prepend);
final Procedure1<FormattingDataInit> _function_1 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append = this._formattingDataFactory.append(leftAngleBracket, _function_1);
format.operator_add(_append);
EList<XTypeParameter> _typeParameters = xClass.getTypeParameters();
this.formatTypeParameters(_typeParameters, format);
ILeafNode _nodeForKeyword = this._nodeModelAccess.nodeForKeyword(xClass, ">");
final Procedure1<FormattingDataInit> _function_2 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_1 = this._formattingDataFactory.prepend(_nodeForKeyword, _function_2);
format.operator_add(_prepend_1);
}
final ILeafNode leftBrace = this._nodeModelAccess.nodeForKeyword(xClass, "{");
final Procedure1<FormattingDataInit> _function_3 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.increaseIndentation();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.increaseIndentation();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append_1 = this._formattingDataFactory.append(leftBrace, _function_3);
format.operator_add(_append_1);
final Procedure1<FormattingDataInit> _function_4 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.newLine();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.newLine();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append_2 = this._formattingDataFactory.append(leftBrace, _function_4);
format.operator_add(_append_2);
EList<XMember> _members = xClass.getMembers();
@@ -382,20 +382,20 @@ public class XcoreFormatter extends XbaseFormatter2 {
this.format(xMember, format);
INode _nodeForEObject = this._nodeModelAccess.nodeForEObject(xMember);
final Procedure1<FormattingDataInit> _function_5 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.newLine();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.newLine();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append_3 = this._formattingDataFactory.append(_nodeForEObject, _function_5);
format.operator_add(_append_3);
}
}
final ILeafNode rightBrace = this._nodeModelAccess.nodeForKeyword(xClass, "}");
final Procedure1<FormattingDataInit> _function_5 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.decreaseIndentation();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.decreaseIndentation();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_2 = this._formattingDataFactory.prepend(rightBrace, _function_5);
format.operator_add(_prepend_2);
}
@@ -407,10 +407,10 @@ public class XcoreFormatter extends XbaseFormatter2 {
boolean _notEquals = (!Objects.equal(multiplicity, null));
if (_notEquals) {
final Procedure1<FormattingDataInit> _function = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend = this._formattingDataFactory.prepend(multiplicity, _function);
format.operator_add(_prepend);
}
@@ -419,10 +419,10 @@ public class XcoreFormatter extends XbaseFormatter2 {
if (_notEquals_1) {
final ILeafNode leftBrace = this._nodeModelAccess.nodeForKeyword(get, "{");
final Procedure1<FormattingDataInit> _function_1 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.oneSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.oneSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_1 = this._formattingDataFactory.prepend(leftBrace, _function_1);
format.operator_add(_prepend_1);
this.format(get, format);
@@ -436,10 +436,10 @@ public class XcoreFormatter extends XbaseFormatter2 {
boolean _notEquals = (!Objects.equal(multiplicity, null));
if (_notEquals) {
final Procedure1<FormattingDataInit> _function = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend = this._formattingDataFactory.prepend(multiplicity, _function);
format.operator_add(_prepend);
}
@@ -448,10 +448,10 @@ public class XcoreFormatter extends XbaseFormatter2 {
if (_notEquals_1) {
final ILeafNode leftBrace = this._nodeModelAccess.nodeForKeyword(get, "{");
final Procedure1<FormattingDataInit> _function_1 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.oneSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.oneSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_1 = this._formattingDataFactory.prepend(leftBrace, _function_1);
format.operator_add(_prepend_1);
this.format(get, format);
@@ -465,10 +465,10 @@ public class XcoreFormatter extends XbaseFormatter2 {
boolean _notEquals = (!Objects.equal(multiplicity, null));
if (_notEquals) {
final Procedure1<FormattingDataInit> _function = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend = this._formattingDataFactory.prepend(multiplicity, _function);
format.operator_add(_prepend);
}
@@ -476,43 +476,43 @@ public class XcoreFormatter extends XbaseFormatter2 {
boolean _notEquals_1 = (!Objects.equal(leftAngleBracket, null));
if (_notEquals_1) {
final Procedure1<FormattingDataInit> _function_1 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_1 = this._formattingDataFactory.prepend(leftAngleBracket, _function_1);
format.operator_add(_prepend_1);
final Procedure1<FormattingDataInit> _function_2 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append = this._formattingDataFactory.append(leftAngleBracket, _function_2);
format.operator_add(_append);
EList<XTypeParameter> _typeParameters = xOperation.getTypeParameters();
this.formatTypeParameters(_typeParameters, format);
ILeafNode _nodeForKeyword = this._nodeModelAccess.nodeForKeyword(xOperation, ">");
final Procedure1<FormattingDataInit> _function_3 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_2 = this._formattingDataFactory.prepend(_nodeForKeyword, _function_3);
format.operator_add(_prepend_2);
}
final ILeafNode leftParenthesis = this._nodeModelAccess.nodeForKeyword(xOperation, "(");
final Procedure1<FormattingDataInit> _function_4 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_3 = this._formattingDataFactory.prepend(leftParenthesis, _function_4);
format.operator_add(_prepend_3);
final Procedure1<FormattingDataInit> _function_5 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _append_1 = this._formattingDataFactory.append(leftParenthesis, _function_5);
format.operator_add(_append_1);
final EList<XParameter> xParameters = xOperation.getParameters();
@@ -521,10 +521,10 @@ public class XcoreFormatter extends XbaseFormatter2 {
if (_not) {
final ILeafNode rightParenthesis = this._nodeModelAccess.nodeForKeyword(xOperation, ")");
final Procedure1<FormattingDataInit> _function_6 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_4 = this._formattingDataFactory.prepend(rightParenthesis, _function_6);
format.operator_add(_prepend_4);
for (final XParameter xParameter : xParameters) {
@@ -536,10 +536,10 @@ public class XcoreFormatter extends XbaseFormatter2 {
if (_notEquals_2) {
final ILeafNode leftBrace = this._nodeModelAccess.nodeForKeyword(body, "{");
final Procedure1<FormattingDataInit> _function_7 = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.oneSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.oneSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend_5 = this._formattingDataFactory.prepend(leftBrace, _function_7);
format.operator_add(_prepend_5);
this.format(body, format);
@@ -553,10 +553,10 @@ public class XcoreFormatter extends XbaseFormatter2 {
boolean _notEquals = (!Objects.equal(multiplicity, null));
if (_notEquals) {
final Procedure1<FormattingDataInit> _function = new Procedure1<FormattingDataInit>() {
- public void apply(final FormattingDataInit it) {
- it.noSpace();
- }
- };
+ public void apply(final FormattingDataInit it) {
+ it.noSpace();
+ }
+ };
Function1<? super FormattableDocument,? extends Iterable<FormattingData>> _prepend = this._formattingDataFactory.prepend(multiplicity, _function);
format.operator_add(_prepend);
}
diff --git a/plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/util/XcoreGenModelBuilder.java b/plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/util/XcoreGenModelBuilder.java
index 08747a4..d659258 100644
--- a/plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/util/XcoreGenModelBuilder.java
+++ b/plugins/org.eclipse.emf.ecore.xcore/xtend-gen/org/eclipse/emf/ecore/xcore/util/XcoreGenModelBuilder.java
@@ -87,136 +87,128 @@ public class XcoreGenModelBuilder {
boolean _matched = false;
if (!_matched) {
if (genElement instanceof GenPackage) {
- final GenPackage _genPackage = (GenPackage)genElement;
_matched=true;
- EPackage _ecorePackage = _genPackage.getEcorePackage();
+ EPackage _ecorePackage = ((GenPackage)genElement).getEcorePackage();
ToXcoreMapping _toXcoreMapping = this.mapper.getToXcoreMapping(_ecorePackage);
XNamedElement _xcoreElement = _toXcoreMapping.getXcoreElement();
final XPackage xPackage = ((XPackage) _xcoreElement);
boolean _notEquals = (!Objects.equal(xPackage, null));
if (_notEquals) {
XPackageMapping _mapping = this.mapper.getMapping(xPackage);
- _mapping.setGenPackage(_genPackage);
- ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(_genPackage);
+ _mapping.setGenPackage(((GenPackage)genElement));
+ ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(genElement);
_toXcoreMapping_1.setXcoreElement(xPackage);
}
}
}
if (!_matched) {
if (genElement instanceof GenClass) {
- final GenClass _genClass = (GenClass)genElement;
_matched=true;
- EClass _ecoreClass = _genClass.getEcoreClass();
+ EClass _ecoreClass = ((GenClass)genElement).getEcoreClass();
ToXcoreMapping _toXcoreMapping = this.mapper.getToXcoreMapping(_ecoreClass);
XNamedElement _xcoreElement = _toXcoreMapping.getXcoreElement();
final XClass xClass = ((XClass) _xcoreElement);
boolean _notEquals = (!Objects.equal(xClass, null));
if (_notEquals) {
XClassMapping _mapping = this.mapper.getMapping(xClass);
- _mapping.setGenClass(_genClass);
- ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(_genClass);
+ _mapping.setGenClass(((GenClass)genElement));
+ ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(genElement);
_toXcoreMapping_1.setXcoreElement(xClass);
}
}
}
if (!_matched) {
if (genElement instanceof GenDataType) {
- final GenDataType _genDataType = (GenDataType)genElement;
_matched=true;
- EDataType _ecoreDataType = _genDataType.getEcoreDataType();
+ EDataType _ecoreDataType = ((GenDataType)genElement).getEcoreDataType();
ToXcoreMapping _toXcoreMapping = this.mapper.getToXcoreMapping(_ecoreDataType);
XNamedElement _xcoreElement = _toXcoreMapping.getXcoreElement();
final XDataType xDataType = ((XDataType) _xcoreElement);
boolean _notEquals = (!Objects.equal(xDataType, null));
if (_notEquals) {
XDataTypeMapping _mapping = this.mapper.getMapping(xDataType);
- _mapping.setGenDataType(_genDataType);
- ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(_genDataType);
+ _mapping.setGenDataType(((GenDataType)genElement));
+ ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(genElement);
_toXcoreMapping_1.setXcoreElement(xDataType);
}
}
}
if (!_matched) {
if (genElement instanceof GenFeature) {
- final GenFeature _genFeature = (GenFeature)genElement;
_matched=true;
- EStructuralFeature _ecoreFeature = _genFeature.getEcoreFeature();
+ EStructuralFeature _ecoreFeature = ((GenFeature)genElement).getEcoreFeature();
ToXcoreMapping _toXcoreMapping = this.mapper.getToXcoreMapping(_ecoreFeature);
XNamedElement _xcoreElement = _toXcoreMapping.getXcoreElement();
final XStructuralFeature xFeature = ((XStructuralFeature) _xcoreElement);
boolean _notEquals = (!Objects.equal(xFeature, null));
if (_notEquals) {
XFeatureMapping _mapping = this.mapper.getMapping(xFeature);
- _mapping.setGenFeature(_genFeature);
- ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(_genFeature);
+ _mapping.setGenFeature(((GenFeature)genElement));
+ ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(genElement);
_toXcoreMapping_1.setXcoreElement(xFeature);
}
}
}
if (!_matched) {
if (genElement instanceof GenOperation) {
- final GenOperation _genOperation = (GenOperation)genElement;
_matched=true;
- EOperation _ecoreOperation = _genOperation.getEcoreOperation();
+ EOperation _ecoreOperation = ((GenOperation)genElement).getEcoreOperation();
ToXcoreMapping _toXcoreMapping = this.mapper.getToXcoreMapping(_ecoreOperation);
XNamedElement _xcoreElement = _toXcoreMapping.getXcoreElement();
final XOperation xOperation = ((XOperation) _xcoreElement);
boolean _notEquals = (!Objects.equal(xOperation, null));
if (_notEquals) {
XOperationMapping _mapping = this.mapper.getMapping(xOperation);
- _mapping.setGenOperation(_genOperation);
- ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(_genOperation);
+ _mapping.setGenOperation(((GenOperation)genElement));
+ ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(genElement);
_toXcoreMapping_1.setXcoreElement(xOperation);
}
}
}
if (!_matched) {
if (genElement instanceof GenParameter) {
- final GenParameter _genParameter = (GenParameter)genElement;
_matched=true;
- EParameter _ecoreParameter = _genParameter.getEcoreParameter();
+ EParameter _ecoreParameter = ((GenParameter)genElement).getEcoreParameter();
ToXcoreMapping _toXcoreMapping = this.mapper.getToXcoreMapping(_ecoreParameter);
XNamedElement _xcoreElement = _toXcoreMapping.getXcoreElement();
final XParameter xParameter = ((XParameter) _xcoreElement);
boolean _notEquals = (!Objects.equal(xParameter, null));
if (_notEquals) {
XParameterMapping _mapping = this.mapper.getMapping(xParameter);
- _mapping.setGenParameter(_genParameter);
- ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(_genParameter);
+ _mapping.setGenParameter(((GenParameter)genElement));
+ ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(genElement);
_toXcoreMapping_1.setXcoreElement(xParameter);
}
}
}
if (!_matched) {
if (genElement instanceof GenTypeParameter) {
- final GenTypeParameter _genTypeParameter = (GenTypeParameter)genElement;
_matched=true;
- ETypeParameter _ecoreTypeParameter = _genTypeParameter.getEcoreTypeParameter();
+ ETypeParameter _ecoreTypeParameter = ((GenTypeParameter)genElement).getEcoreTypeParameter();
ToXcoreMapping _toXcoreMapping = this.mapper.getToXcoreMapping(_ecoreTypeParameter);
XNamedElement _xcoreElement = _toXcoreMapping.getXcoreElement();
final XTypeParameter xTypeParameter = ((XTypeParameter) _xcoreElement);
boolean _notEquals = (!Objects.equal(xTypeParameter, null));
if (_notEquals) {
XTypeParameterMapping _mapping = this.mapper.getMapping(xTypeParameter);
- _mapping.setGenTypeParameter(_genTypeParameter);
- ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(_genTypeParameter);
+ _mapping.setGenTypeParameter(((GenTypeParameter)genElement));
+ ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(genElement);
_toXcoreMapping_1.setXcoreElement(xTypeParameter);
}
}
}
if (!_matched) {
if (genElement instanceof GenEnumLiteral) {
- final GenEnumLiteral _genEnumLiteral = (GenEnumLiteral)genElement;
_matched=true;
- EEnumLiteral _ecoreEnumLiteral = _genEnumLiteral.getEcoreEnumLiteral();
+ EEnumLiteral _ecoreEnumLiteral = ((GenEnumLiteral)genElement).getEcoreEnumLiteral();
ToXcoreMapping _toXcoreMapping = this.mapper.getToXcoreMapping(_ecoreEnumLiteral);
XNamedElement _xcoreElement = _toXcoreMapping.getXcoreElement();
final XEnumLiteral xEnumLiteral = ((XEnumLiteral) _xcoreElement);
boolean _notEquals = (!Objects.equal(xEnumLiteral, null));
if (_notEquals) {
XEnumLiteralMapping _mapping = this.mapper.getMapping(xEnumLiteral);
- _mapping.setGenEnumLiteral(_genEnumLiteral);
- ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(_genEnumLiteral);
+ _mapping.setGenEnumLiteral(((GenEnumLiteral)genElement));
+ ToXcoreMapping _toXcoreMapping_1 = this.mapper.getToXcoreMapping(genElement);
_toXcoreMapping_1.setXcoreElement(xEnumLiteral);
}
}
@@ -263,18 +255,16 @@ public class XcoreGenModelBuilder {
boolean _matched = false;
if (!_matched) {
if (eCrossReference instanceof EClassifier) {
- final EClassifier _eClassifier = (EClassifier)eCrossReference;
_matched=true;
- final EPackage referencedEPackage = _eClassifier.getEPackage();
+ final EPackage referencedEPackage = ((EClassifier)eCrossReference).getEPackage();
ePackages.add(referencedEPackage);
referencedEPackages.add(referencedEPackage);
}
}
if (!_matched) {
if (eCrossReference instanceof EStructuralFeature) {
- final EStructuralFeature _eStructuralFeature = (EStructuralFeature)eCrossReference;
_matched=true;
- final EClass eContainingClass = _eStructuralFeature.getEContainingClass();
+ final EClass eContainingClass = ((EStructuralFeature)eCrossReference).getEContainingClass();
boolean _notEquals = (!Objects.equal(eContainingClass, null));
if (_notEquals) {
final EPackage referencedEPackage = eContainingClass.getEPackage();
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/interpreter/XcoreInterpreterXbaseIntegrationTest.java b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/interpreter/XcoreInterpreterXbaseIntegrationTest.java
index 7d52434..74e5169 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/interpreter/XcoreInterpreterXbaseIntegrationTest.java
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/interpreter/XcoreInterpreterXbaseIntegrationTest.java
@@ -52,6 +52,14 @@ public class XcoreInterpreterXbaseIntegrationTest extends AbstractXbaseEvaluatio
{
assertEvaluatesTo(Boolean.TRUE, "typeof(java.lang.^annotation.RetentionPolicy).enum");
}
+
+ @Override
+ @Test
+ public void testSwitchExpression_27() throws Exception {
+ // annotation is a reserved word in Xcore
+ assertEvaluatesTo(null,
+ "{ val Object policy = java.lang.^annotation.RetentionPolicy.SOURCE switch policy { java.lang.^annotation.RetentionPolicy case CLASS: false } }");
+ }
@Override
@Test
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/xtend-gen/org/eclipse/emf/test/ecore/xcore/mapping/XcoreMapperTest.java b/tests/org.eclipse.emf.test.ecore.xcore/xtend-gen/org/eclipse/emf/test/ecore/xcore/mapping/XcoreMapperTest.java
index 3a0fde9..9b30772 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/xtend-gen/org/eclipse/emf/test/ecore/xcore/mapping/XcoreMapperTest.java
+++ b/tests/org.eclipse.emf.test.ecore.xcore/xtend-gen/org/eclipse/emf/test/ecore/xcore/mapping/XcoreMapperTest.java
@@ -143,53 +143,51 @@ public class XcoreMapperTest {
boolean _matched = false;
if (!_matched) {
if (member instanceof XStructuralFeature) {
- final XStructuralFeature _xStructuralFeature = (XStructuralFeature)member;
_matched=true;
- XFeatureMapping _mapping_10 = this.mapper.getMapping(_xStructuralFeature);
+ XFeatureMapping _mapping_10 = this.mapper.getMapping(((XStructuralFeature)member));
EStructuralFeature _eStructuralFeature = _mapping_10.getEStructuralFeature();
Assert.assertNotNull(_eStructuralFeature);
- XFeatureMapping _mapping_11 = this.mapper.getMapping(_xStructuralFeature);
+ XFeatureMapping _mapping_11 = this.mapper.getMapping(((XStructuralFeature)member));
EStructuralFeature _eStructuralFeature_1 = _mapping_11.getEStructuralFeature();
- XFeatureMapping _mapping_12 = this.mapper.getMapping(_xStructuralFeature);
+ XFeatureMapping _mapping_12 = this.mapper.getMapping(((XStructuralFeature)member));
GenFeature _genFeature = _mapping_12.getGenFeature();
EStructuralFeature _ecoreFeature = _genFeature.getEcoreFeature();
Assert.assertEquals(_eStructuralFeature_1, _ecoreFeature);
- XFeatureMapping _mapping_13 = this.mapper.getMapping(_xStructuralFeature);
+ XFeatureMapping _mapping_13 = this.mapper.getMapping(((XStructuralFeature)member));
EStructuralFeature _eStructuralFeature_2 = _mapping_13.getEStructuralFeature();
ToXcoreMapping _toXcoreMapping_4 = this.mapper.getToXcoreMapping(_eStructuralFeature_2);
XNamedElement _xcoreElement_4 = _toXcoreMapping_4.getXcoreElement();
- Assert.assertEquals(_xStructuralFeature, _xcoreElement_4);
- XFeatureMapping _mapping_14 = this.mapper.getMapping(_xStructuralFeature);
+ Assert.assertEquals(member, _xcoreElement_4);
+ XFeatureMapping _mapping_14 = this.mapper.getMapping(((XStructuralFeature)member));
GenFeature _genFeature_1 = _mapping_14.getGenFeature();
ToXcoreMapping _toXcoreMapping_5 = this.mapper.getToXcoreMapping(_genFeature_1);
XNamedElement _xcoreElement_5 = _toXcoreMapping_5.getXcoreElement();
- Assert.assertEquals(_xStructuralFeature, _xcoreElement_5);
+ Assert.assertEquals(member, _xcoreElement_5);
}
}
if (!_matched) {
if (member instanceof XOperation) {
- final XOperation _xOperation = (XOperation)member;
_matched=true;
- XOperationMapping _mapping_10 = this.mapper.getMapping(_xOperation);
+ XOperationMapping _mapping_10 = this.mapper.getMapping(((XOperation)member));
EOperation _eOperation = _mapping_10.getEOperation();
Assert.assertNotNull(_eOperation);
- XOperationMapping _mapping_11 = this.mapper.getMapping(_xOperation);
+ XOperationMapping _mapping_11 = this.mapper.getMapping(((XOperation)member));
EOperation _eOperation_1 = _mapping_11.getEOperation();
- XOperationMapping _mapping_12 = this.mapper.getMapping(_xOperation);
+ XOperationMapping _mapping_12 = this.mapper.getMapping(((XOperation)member));
GenOperation _genOperation = _mapping_12.getGenOperation();
EOperation _ecoreOperation = _genOperation.getEcoreOperation();
Assert.assertEquals(_eOperation_1, _ecoreOperation);
- XOperationMapping _mapping_13 = this.mapper.getMapping(_xOperation);
+ XOperationMapping _mapping_13 = this.mapper.getMapping(((XOperation)member));
EOperation _eOperation_2 = _mapping_13.getEOperation();
ToXcoreMapping _toXcoreMapping_4 = this.mapper.getToXcoreMapping(_eOperation_2);
XNamedElement _xcoreElement_4 = _toXcoreMapping_4.getXcoreElement();
- Assert.assertEquals(_xOperation, _xcoreElement_4);
- XOperationMapping _mapping_14 = this.mapper.getMapping(_xOperation);
+ Assert.assertEquals(member, _xcoreElement_4);
+ XOperationMapping _mapping_14 = this.mapper.getMapping(((XOperation)member));
GenOperation _genOperation_1 = _mapping_14.getGenOperation();
ToXcoreMapping _toXcoreMapping_5 = this.mapper.getToXcoreMapping(_genOperation_1);
XNamedElement _xcoreElement_5 = _toXcoreMapping_5.getXcoreElement();
- Assert.assertEquals(_xOperation, _xcoreElement_5);
- EList<XParameter> _parameters = _xOperation.getParameters();
+ Assert.assertEquals(member, _xcoreElement_5);
+ EList<XParameter> _parameters = ((XOperation)member).getParameters();
for (final XParameter parameter : _parameters) {
{
XParameterMapping _mapping_15 = this.mapper.getMapping(parameter);