Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2017-08-04 10:38:25 -0400
committerHenrik Rentz-Reichert2017-08-04 10:38:25 -0400
commitd74f1ebc1003c2277b9ac837ef64cd9f68520588 (patch)
treeb977c7b2381d1d76338ac581de78c143c926dd1e
parent14836e2e86dedc1ddbe57fdb645f1e3ad6835bbf (diff)
downloadorg.eclipse.etrice-d74f1ebc1003c2277b9ac837ef64cd9f68520588.tar.gz
org.eclipse.etrice-d74f1ebc1003c2277b9ac837ef64cd9f68520588.tar.xz
org.eclipse.etrice-d74f1ebc1003c2277b9ac837ef64cd9f68520588.zip
Bug 511330 - [core.genmodel.fsm] introduce simplified generator model
for state machines Fixed bug in model transformation. Change-Id: I1e8d62aa510caa9f8b4ee6a8303f6cc3a1f5f7b4
-rw-r--r--plugins/org.eclipse.etrice.core.fsm/src/org/eclipse/etrice/core/fsm/util/FSMHelpers.java15
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.xtend7
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java9
-rw-r--r--plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/room/util/CommonDataCalculator.java66
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java8
-rw-r--r--plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/DocGen.java74
-rw-r--r--plugins/org.eclipse.etrice.generator.fsm/xtend-gen/org/eclipse/etrice/generator/fsm/generic/AbstractStateMachineGenerator.java8
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.java8
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java8
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java8
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/VariableServiceGen.java32
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java16
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java93
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java31
-rw-r--r--plugins/org.eclipse.etrice.ui.behavior/xtend-gen/org/eclipse/etrice/ui/behavior/detailcode/DefaultDetailExpressionProvider.java9
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend3
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.java3
17 files changed, 178 insertions, 220 deletions
diff --git a/plugins/org.eclipse.etrice.core.fsm/src/org/eclipse/etrice/core/fsm/util/FSMHelpers.java b/plugins/org.eclipse.etrice.core.fsm/src/org/eclipse/etrice/core/fsm/util/FSMHelpers.java
index e59f2e8af..38f91a58c 100644
--- a/plugins/org.eclipse.etrice.core.fsm/src/org/eclipse/etrice/core/fsm/util/FSMHelpers.java
+++ b/plugins/org.eclipse.etrice.core.fsm/src/org/eclipse/etrice/core/fsm/util/FSMHelpers.java
@@ -367,6 +367,21 @@ public class FSMHelpers extends BaseHelpers {
return targetting;
}
+ public SimpleState getFinalTarget(RefinedState state) {
+ State target = state.getTarget();
+ if (target instanceof SimpleState) {
+ return (SimpleState) target;
+ }
+ else if (target instanceof RefinedState) {
+ return getFinalTarget((RefinedState) target);
+ }
+ else {
+ // must never happen
+ assert(false) : "unexpected sub type";
+ return null;
+ }
+ }
+
/**
* Returns <code>false</code> if the {@link DetailCode} is null or empty.
*
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.xtend b/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.xtend
index a27dfd142..f0623566d 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.xtend
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.xtend
@@ -112,6 +112,9 @@ class BasicFsmGenBuilder {
}
private def handleRefinedState(RefinedState s) {
+ // we pick the node that initially was created from a SimpleState
+ val refinedNode = s.finalTarget.createNode
+
// handle the sub graphs
if (s.subgraph!==null) {
if (s.target.subgraph!==null) {
@@ -119,13 +122,13 @@ class BasicFsmGenBuilder {
targetGraph.mergeGraph(s.subgraph)
}
else {
- s.target.createNode.subgraph = s.subgraph.createGraph
+ refinedNode.subgraph = s.subgraph.createGraph
}
}
// else nothing to do, whether the targetGraph exists or not
// change the target Node's stateGraphNode to our RefinedState
- val target = s.target.createNode
+ val target = refinedNode
target.stateGraphNode = s
}
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java
index c27268adc..df9d3de3f 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java
@@ -232,6 +232,8 @@ public class BasicFsmGenBuilder {
}
private void handleRefinedState(final RefinedState s) {
+ SimpleState _finalTarget = this.fsmHelpers.getFinalTarget(s);
+ final Node refinedNode = this.createNode(_finalTarget);
StateGraph _subgraph = s.getSubgraph();
boolean _tripleNotEquals = (_subgraph != null);
if (_tripleNotEquals) {
@@ -245,15 +247,12 @@ public class BasicFsmGenBuilder {
StateGraph _subgraph_3 = s.getSubgraph();
this.mergeGraph(targetGraph, _subgraph_3);
} else {
- State _target_2 = s.getTarget();
- Node _createNode = this.createNode(_target_2);
StateGraph _subgraph_4 = s.getSubgraph();
Graph _createGraph = this.createGraph(_subgraph_4);
- _createNode.setSubgraph(_createGraph);
+ refinedNode.setSubgraph(_createGraph);
}
}
- State _target_3 = s.getTarget();
- final Node target = this.createNode(_target_3);
+ final Node target = refinedNode;
target.setStateGraphNode(s);
}
diff --git a/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/room/util/CommonDataCalculator.java b/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/room/util/CommonDataCalculator.java
index 976d28914..1acb3d3a8 100644
--- a/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/room/util/CommonDataCalculator.java
+++ b/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/room/util/CommonDataCalculator.java
@@ -46,52 +46,37 @@ public class CommonDataCalculator implements ICommonDataCalculator {
return null;
} else {
EList<Link> _chainHeads = l.getChainHeads();
- final Function1<Link, TransitionBase> _function = new Function1<Link, TransitionBase>() {
- @Override
- public TransitionBase apply(final Link it) {
- TransitionBase _transition = it.getTransition();
- return CommonDataCalculator.realTransition(_transition);
- }
+ final Function1<Link, TransitionBase> _function = (Link it) -> {
+ TransitionBase _transition = it.getTransition();
+ return CommonDataCalculator.realTransition(_transition);
};
List<TransitionBase> _map = ListExtensions.<Link, TransitionBase>map(_chainHeads, _function);
Iterable<TriggeredTransition> transitions = Iterables.<TriggeredTransition>filter(_map, TriggeredTransition.class);
- final Function1<TriggeredTransition, EList<Trigger>> _function_1 = new Function1<TriggeredTransition, EList<Trigger>>() {
- @Override
- public EList<Trigger> apply(final TriggeredTransition it) {
- return it.getTriggers();
- }
+ final Function1<TriggeredTransition, EList<Trigger>> _function_1 = (TriggeredTransition it) -> {
+ return it.getTriggers();
};
Iterable<EList<Trigger>> _map_1 = IterableExtensions.<TriggeredTransition, EList<Trigger>>map(transitions, _function_1);
final Iterable<Trigger> triggers = Iterables.<Trigger>concat(_map_1);
- final Function1<Trigger, EList<MessageFromIf>> _function_2 = new Function1<Trigger, EList<MessageFromIf>>() {
- @Override
- public EList<MessageFromIf> apply(final Trigger it) {
- return it.getMsgFromIfPairs();
- }
+ final Function1<Trigger, EList<MessageFromIf>> _function_2 = (Trigger it) -> {
+ return it.getMsgFromIfPairs();
};
Iterable<EList<MessageFromIf>> _map_2 = IterableExtensions.<Trigger, EList<MessageFromIf>>map(triggers, _function_2);
Iterable<MessageFromIf> _flatten = Iterables.<MessageFromIf>concat(_map_2);
- final Function1<MessageFromIf, VarDecl> _function_3 = new Function1<MessageFromIf, VarDecl>() {
- @Override
- public VarDecl apply(final MessageFromIf it) {
- EObject _message = it.getMessage();
- return ((Message) _message).getData();
- }
+ final Function1<MessageFromIf, VarDecl> _function_3 = (MessageFromIf it) -> {
+ EObject _message = it.getMessage();
+ return ((Message) _message).getData();
};
final Iterable<VarDecl> varDeclarations = IterableExtensions.<MessageFromIf, VarDecl>map(_flatten, _function_3);
- final Function1<VarDecl, DataType> _function_4 = new Function1<VarDecl, DataType>() {
- @Override
- public DataType apply(final VarDecl it) {
- RefableType _refType = null;
- if (it!=null) {
- _refType=it.getRefType();
- }
- DataType _type = null;
- if (_refType!=null) {
- _type=_refType.getType();
- }
- return _type;
+ final Function1<VarDecl, DataType> _function_4 = (VarDecl it) -> {
+ RefableType _refType = null;
+ if (it!=null) {
+ _refType=it.getRefType();
+ }
+ DataType _type = null;
+ if (_refType!=null) {
+ _type=_refType.getType();
}
+ return _type;
};
Iterable<DataType> _map_3 = IterableExtensions.<VarDecl, DataType>map(varDeclarations, _function_4);
final Set<DataType> allData = IterableExtensions.<DataType>toSet(_map_3);
@@ -100,15 +85,12 @@ public class CommonDataCalculator implements ICommonDataCalculator {
if (_equals) {
return IterableExtensions.<VarDecl>head(varDeclarations);
} else {
- final Function1<VarDecl, RefableType> _function_5 = new Function1<VarDecl, RefableType>() {
- @Override
- public RefableType apply(final VarDecl it) {
- RefableType _refType = null;
- if (it!=null) {
- _refType=it.getRefType();
- }
- return _refType;
+ final Function1<VarDecl, RefableType> _function_5 = (VarDecl it) -> {
+ RefableType _refType = null;
+ if (it!=null) {
+ _refType=it.getRefType();
}
+ return _refType;
};
Iterable<RefableType> _map_4 = IterableExtensions.<VarDecl, RefableType>map(varDeclarations, _function_5);
final List<RefableType> types = IterableExtensions.<RefableType>toList(_map_4);
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java
index 5af97bc83..7bfea170e 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java
@@ -17,6 +17,7 @@ import com.google.inject.Singleton;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.function.Consumer;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.fsm.fSM.ComponentCommunicationType;
import org.eclipse.etrice.core.fsm.fSM.DetailCode;
@@ -54,7 +55,6 @@ import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.ListExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
@Singleton
@SuppressWarnings("all")
@@ -89,14 +89,14 @@ public class ActorClassGen extends GenericActorClassGenerator {
final Map<ActorClass, WiredActorClass> ac2wired = CollectionLiterals.<ActorClass, WiredActorClass>newHashMap();
EList<WiredStructureClass> _wiredInstances = root.getWiredInstances();
Iterable<WiredActorClass> _filter = Iterables.<WiredActorClass>filter(_wiredInstances, WiredActorClass.class);
- final Procedure1<WiredActorClass> _function = new Procedure1<WiredActorClass>() {
+ final Consumer<WiredActorClass> _function = new Consumer<WiredActorClass>() {
@Override
- public void apply(final WiredActorClass it) {
+ public void accept(final WiredActorClass it) {
ActorClass _actorClass = it.getActorClass();
ac2wired.put(_actorClass, it);
}
};
- IterableExtensions.<WiredActorClass>forEach(_filter, _function);
+ _filter.forEach(_function);
EList<ExpandedActorClass> _xpActorClasses = root.getXpActorClasses();
final Function1<ExpandedActorClass, Boolean> _function_1 = new Function1<ExpandedActorClass, Boolean>() {
@Override
diff --git a/plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/DocGen.java b/plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/DocGen.java
index 6625d68f9..f01eb97fc 100644
--- a/plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/DocGen.java
+++ b/plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/DocGen.java
@@ -17,6 +17,7 @@ import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
+import java.util.function.Consumer;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.common.base.Documentation;
import org.eclipse.etrice.core.common.base.util.RelativePathHelpers;
@@ -54,7 +55,6 @@ import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
@Singleton
@SuppressWarnings("all")
@@ -107,119 +107,119 @@ public class DocGen {
String _plus = (path + _name_1);
this.fileAccess.setOutputPath(_plus);
EList<LogicalSystem> _systems = model.getSystems();
- final Procedure1<LogicalSystem> _function = new Procedure1<LogicalSystem>() {
+ final Consumer<LogicalSystem> _function = new Consumer<LogicalSystem>() {
@Override
- public void apply(final LogicalSystem it) {
+ public void accept(final LogicalSystem it) {
CharSequence _generateDoc = DocGen.this.generateDoc(it, ctx);
String _docFragmentName = DocGen.this.docFragmentName(it);
DocGen.this.saveAs(_generateDoc, _docFragmentName);
}
};
- IterableExtensions.<LogicalSystem>forEach(_systems, _function);
+ _systems.forEach(_function);
EList<LogicalSystem> _systems_1 = model.getSystems();
- final Procedure1<LogicalSystem> _function_1 = new Procedure1<LogicalSystem>() {
+ final Consumer<LogicalSystem> _function_1 = new Consumer<LogicalSystem>() {
@Override
- public void apply(final LogicalSystem it) {
+ public void accept(final LogicalSystem it) {
EList<RoomModel> _referencedModels = root.getReferencedModels(it);
referencedModels.addAll(_referencedModels);
}
};
- IterableExtensions.<LogicalSystem>forEach(_systems_1, _function_1);
+ _systems_1.forEach(_function_1);
EList<SubSystemClass> _subSystemClasses = model.getSubSystemClasses();
- final Procedure1<SubSystemClass> _function_2 = new Procedure1<SubSystemClass>() {
+ final Consumer<SubSystemClass> _function_2 = new Consumer<SubSystemClass>() {
@Override
- public void apply(final SubSystemClass it) {
+ public void accept(final SubSystemClass it) {
CharSequence _generateDoc = DocGen.this.generateDoc(it, ctx);
String _docFragmentName = DocGen.this.docFragmentName(it);
DocGen.this.saveAs(_generateDoc, _docFragmentName);
}
};
- IterableExtensions.<SubSystemClass>forEach(_subSystemClasses, _function_2);
+ _subSystemClasses.forEach(_function_2);
EList<SubSystemClass> _subSystemClasses_1 = model.getSubSystemClasses();
- final Procedure1<SubSystemClass> _function_3 = new Procedure1<SubSystemClass>() {
+ final Consumer<SubSystemClass> _function_3 = new Consumer<SubSystemClass>() {
@Override
- public void apply(final SubSystemClass it) {
+ public void accept(final SubSystemClass it) {
EList<RoomModel> _referencedModels = root.getReferencedModels(it);
referencedModels.addAll(_referencedModels);
}
};
- IterableExtensions.<SubSystemClass>forEach(_subSystemClasses_1, _function_3);
+ _subSystemClasses_1.forEach(_function_3);
EList<GeneralProtocolClass> _protocolClasses = model.getProtocolClasses();
- final Procedure1<GeneralProtocolClass> _function_4 = new Procedure1<GeneralProtocolClass>() {
+ final Consumer<GeneralProtocolClass> _function_4 = new Consumer<GeneralProtocolClass>() {
@Override
- public void apply(final GeneralProtocolClass it) {
+ public void accept(final GeneralProtocolClass it) {
CharSequence _generateDoc = DocGen.this.generateDoc(it, ctx);
String _docFragmentName = DocGen.this.docFragmentName(it);
DocGen.this.saveAs(_generateDoc, _docFragmentName);
}
};
- IterableExtensions.<GeneralProtocolClass>forEach(_protocolClasses, _function_4);
+ _protocolClasses.forEach(_function_4);
EList<GeneralProtocolClass> _protocolClasses_1 = model.getProtocolClasses();
- final Procedure1<GeneralProtocolClass> _function_5 = new Procedure1<GeneralProtocolClass>() {
+ final Consumer<GeneralProtocolClass> _function_5 = new Consumer<GeneralProtocolClass>() {
@Override
- public void apply(final GeneralProtocolClass it) {
+ public void accept(final GeneralProtocolClass it) {
EList<RoomModel> _referencedModels = root.getReferencedModels(it);
referencedModels.addAll(_referencedModels);
}
};
- IterableExtensions.<GeneralProtocolClass>forEach(_protocolClasses_1, _function_5);
+ _protocolClasses_1.forEach(_function_5);
EList<EnumerationType> _enumerationTypes = model.getEnumerationTypes();
- final Procedure1<EnumerationType> _function_6 = new Procedure1<EnumerationType>() {
+ final Consumer<EnumerationType> _function_6 = new Consumer<EnumerationType>() {
@Override
- public void apply(final EnumerationType it) {
+ public void accept(final EnumerationType it) {
CharSequence _generateDoc = DocGen.this.generateDoc(it, ctx);
String _docFragmentName = DocGen.this.docFragmentName(it);
DocGen.this.saveAs(_generateDoc, _docFragmentName);
}
};
- IterableExtensions.<EnumerationType>forEach(_enumerationTypes, _function_6);
+ _enumerationTypes.forEach(_function_6);
EList<EnumerationType> _enumerationTypes_1 = model.getEnumerationTypes();
- final Procedure1<EnumerationType> _function_7 = new Procedure1<EnumerationType>() {
+ final Consumer<EnumerationType> _function_7 = new Consumer<EnumerationType>() {
@Override
- public void apply(final EnumerationType it) {
+ public void accept(final EnumerationType it) {
EList<RoomModel> _referencedModels = root.getReferencedModels(it);
referencedModels.addAll(_referencedModels);
}
};
- IterableExtensions.<EnumerationType>forEach(_enumerationTypes_1, _function_7);
+ _enumerationTypes_1.forEach(_function_7);
EList<DataClass> _dataClasses = model.getDataClasses();
- final Procedure1<DataClass> _function_8 = new Procedure1<DataClass>() {
+ final Consumer<DataClass> _function_8 = new Consumer<DataClass>() {
@Override
- public void apply(final DataClass it) {
+ public void accept(final DataClass it) {
CharSequence _generateDoc = DocGen.this.generateDoc(it, ctx);
String _docFragmentName = DocGen.this.docFragmentName(it);
DocGen.this.saveAs(_generateDoc, _docFragmentName);
}
};
- IterableExtensions.<DataClass>forEach(_dataClasses, _function_8);
+ _dataClasses.forEach(_function_8);
EList<DataClass> _dataClasses_1 = model.getDataClasses();
- final Procedure1<DataClass> _function_9 = new Procedure1<DataClass>() {
+ final Consumer<DataClass> _function_9 = new Consumer<DataClass>() {
@Override
- public void apply(final DataClass it) {
+ public void accept(final DataClass it) {
EList<RoomModel> _referencedModels = root.getReferencedModels(it);
referencedModels.addAll(_referencedModels);
}
};
- IterableExtensions.<DataClass>forEach(_dataClasses_1, _function_9);
+ _dataClasses_1.forEach(_function_9);
EList<ActorClass> _actorClasses = model.getActorClasses();
- final Procedure1<ActorClass> _function_10 = new Procedure1<ActorClass>() {
+ final Consumer<ActorClass> _function_10 = new Consumer<ActorClass>() {
@Override
- public void apply(final ActorClass it) {
+ public void accept(final ActorClass it) {
CharSequence _generateDoc = DocGen.this.generateDoc(it, ctx);
String _docFragmentName = DocGen.this.docFragmentName(it);
DocGen.this.saveAs(_generateDoc, _docFragmentName);
}
};
- IterableExtensions.<ActorClass>forEach(_actorClasses, _function_10);
+ _actorClasses.forEach(_function_10);
EList<ActorClass> _actorClasses_1 = model.getActorClasses();
- final Procedure1<ActorClass> _function_11 = new Procedure1<ActorClass>() {
+ final Consumer<ActorClass> _function_11 = new Consumer<ActorClass>() {
@Override
- public void apply(final ActorClass it) {
+ public void accept(final ActorClass it) {
EList<RoomModel> _referencedModels = root.getReferencedModels(it);
referencedModels.addAll(_referencedModels);
}
};
- IterableExtensions.<ActorClass>forEach(_actorClasses_1, _function_11);
+ _actorClasses_1.forEach(_function_11);
this.fileAccess.setOutputPath(path);
CharSequence _generateModelDoc = this.generateModelDoc(ctx, referencedModels);
this.saveAs(_generateModelDoc, file);
diff --git a/plugins/org.eclipse.etrice.generator.fsm/xtend-gen/org/eclipse/etrice/generator/fsm/generic/AbstractStateMachineGenerator.java b/plugins/org.eclipse.etrice.generator.fsm/xtend-gen/org/eclipse/etrice/generator/fsm/generic/AbstractStateMachineGenerator.java
index 840313c11..568cdede2 100644
--- a/plugins/org.eclipse.etrice.generator.fsm/xtend-gen/org/eclipse/etrice/generator/fsm/generic/AbstractStateMachineGenerator.java
+++ b/plugins/org.eclipse.etrice.generator.fsm/xtend-gen/org/eclipse/etrice/generator/fsm/generic/AbstractStateMachineGenerator.java
@@ -18,6 +18,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.etrice.core.fsm.fSM.AbstractInterfaceItem;
@@ -57,7 +58,6 @@ import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.IteratorExtensions;
import org.eclipse.xtext.xbase.lib.ListExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
/**
* @author Henrik Rentz-Reichert
@@ -513,14 +513,14 @@ public abstract class AbstractStateMachineGenerator {
};
final List<Node> nodes = IterableExtensions.<Node, String>sortBy(_list, _function);
final HashMap<State, Node> state2node = CollectionLiterals.<State, Node>newHashMap();
- final Procedure1<Node> _function_1 = new Procedure1<Node>() {
+ final Consumer<Node> _function_1 = new Consumer<Node>() {
@Override
- public void apply(final Node it) {
+ public void accept(final Node it) {
StateGraphNode _stateGraphNode = it.getStateGraphNode();
state2node.put(((State) _stateGraphNode), it);
}
};
- IterableExtensions.<Node>forEach(nodes, _function_1);
+ nodes.forEach(_function_1);
final Function1<Node, StateGraphNode> _function_2 = new Function1<Node, StateGraphNode>() {
@Override
public StateGraphNode apply(final Node it) {
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.java
index 953079288..c0b669be4 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.java
@@ -14,6 +14,7 @@ import com.google.common.base.Objects;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.HashMap;
+import java.util.function.Consumer;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.fsm.fSM.ModelComponent;
import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
@@ -32,7 +33,6 @@ import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
@Singleton
@SuppressWarnings("all")
@@ -66,14 +66,14 @@ public class ActorClassDataGen {
}
};
Iterable<WiredStructureClass> _filter = IterableExtensions.<WiredStructureClass>filter(_wiredInstances, _function);
- final Procedure1<WiredStructureClass> _function_1 = new Procedure1<WiredStructureClass>() {
+ final Consumer<WiredStructureClass> _function_1 = new Consumer<WiredStructureClass>() {
@Override
- public void apply(final WiredStructureClass w) {
+ public void accept(final WiredStructureClass w) {
ActorClass _actorClass = ((WiredActorClass) w).getActorClass();
ac2wired.put(_actorClass, ((WiredActorClass) w));
}
};
- IterableExtensions.<WiredStructureClass>forEach(_filter, _function_1);
+ _filter.forEach(_function_1);
EList<ExpandedActorClass> _xpActorClasses = root.getXpActorClasses();
final Function1<ExpandedActorClass, Boolean> _function_2 = new Function1<ExpandedActorClass, Boolean>() {
@Override
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java
index c8c1c9f59..12b6e2ce6 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java
@@ -15,6 +15,7 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.HashMap;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.fsm.fSM.ComponentCommunicationType;
import org.eclipse.etrice.core.genmodel.builder.GenmodelConstants;
@@ -60,7 +61,6 @@ import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.eclipse.xtext.xbase.lib.StringExtensions;
@Singleton
@@ -117,14 +117,14 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
};
Iterable<WiredStructureClass> _filter = IterableExtensions.<WiredStructureClass>filter(_wiredInstances, _function);
- final Procedure1<WiredStructureClass> _function_1 = new Procedure1<WiredStructureClass>() {
+ final Consumer<WiredStructureClass> _function_1 = new Consumer<WiredStructureClass>() {
@Override
- public void apply(final WiredStructureClass w) {
+ public void accept(final WiredStructureClass w) {
ActorClass _actorClass = ((WiredActorClass) w).getActorClass();
ac2wired.put(_actorClass, ((WiredActorClass) w));
}
};
- IterableExtensions.<WiredStructureClass>forEach(_filter, _function_1);
+ _filter.forEach(_function_1);
EList<ExpandedActorClass> _xpActorClasses = root.getXpActorClasses();
final Function1<ExpandedActorClass, Boolean> _function_2 = new Function1<ExpandedActorClass, Boolean>() {
@Override
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java
index b8cab302d..345f2e571 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java
@@ -4,6 +4,7 @@ import com.google.common.base.Objects;
import com.google.inject.Inject;
import java.util.HashMap;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.genmodel.etricegen.OpenBinding;
import org.eclipse.etrice.core.genmodel.etricegen.OpenServiceConnection;
@@ -24,7 +25,6 @@ import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
@SuppressWarnings("all")
public class OptionalActorFactoryGen {
@@ -57,14 +57,14 @@ public class OptionalActorFactoryGen {
}
};
Iterable<WiredStructureClass> _filter = IterableExtensions.<WiredStructureClass>filter(_wiredInstances, _function);
- final Procedure1<WiredStructureClass> _function_1 = new Procedure1<WiredStructureClass>() {
+ final Consumer<WiredStructureClass> _function_1 = new Consumer<WiredStructureClass>() {
@Override
- public void apply(final WiredStructureClass w) {
+ public void accept(final WiredStructureClass w) {
ActorClass _actorClass = ((WiredActorClass) w).getActorClass();
ac2wired.put(_actorClass, ((WiredActorClass) w));
}
};
- IterableExtensions.<WiredStructureClass>forEach(_filter, _function_1);
+ _filter.forEach(_function_1);
EList<OptionalActorInstance> _optionalInstances = root.getOptionalInstances();
final Function1<OptionalActorInstance, Boolean> _function_2 = new Function1<OptionalActorInstance, Boolean>() {
@Override
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/VariableServiceGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/VariableServiceGen.java
index 91d7954e7..e68fb3122 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/VariableServiceGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/VariableServiceGen.java
@@ -21,6 +21,7 @@ import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
+import java.util.function.Consumer;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.etrice.core.common.converter.TimeConverter;
@@ -47,7 +48,6 @@ import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Conversions;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.eclipse.xtext.xbase.lib.StringExtensions;
@Singleton
@@ -104,9 +104,9 @@ public class VariableServiceGen {
final String clsname = this.stdExt.getJavaClassName(nr, comp);
final HashMap<ActorInstance, List<Attribute>> aisAttrMap = new HashMap<ActorInstance, List<Attribute>>();
EList<ActorInstance> _allContainedInstances = comp.getAllContainedInstances();
- final Procedure1<ActorInstance> _function = new Procedure1<ActorInstance>() {
+ final Consumer<ActorInstance> _function = new Consumer<ActorInstance>() {
@Override
- public void apply(final ActorInstance ai) {
+ public void accept(final ActorInstance ai) {
List<Attribute> _dynConfigReadAttributes = VariableServiceGen.this.configExt.getDynConfigReadAttributes(ai);
boolean _isEmpty = _dynConfigReadAttributes.isEmpty();
boolean _not = (!_isEmpty);
@@ -116,7 +116,7 @@ public class VariableServiceGen {
}
}
};
- IterableExtensions.<ActorInstance>forEach(_allContainedInstances, _function);
+ _allContainedInstances.forEach(_function);
StringConcatenation _builder = new StringConcatenation();
_builder.newLine();
_builder.append("package ");
@@ -563,13 +563,13 @@ public class VariableServiceGen {
private HashSet<DataClass> getDynConfigDataClasses(final Iterable<ActorInstance> ais) {
final HashSet<DataClass> result = new HashSet<DataClass>();
- final Procedure1<ActorInstance> _function = new Procedure1<ActorInstance>() {
+ final Consumer<ActorInstance> _function = new Consumer<ActorInstance>() {
@Override
- public void apply(final ActorInstance ai) {
+ public void accept(final ActorInstance ai) {
List<Attribute> _dynConfigReadAttributes = VariableServiceGen.this.configExt.getDynConfigReadAttributes(ai);
- final Procedure1<Attribute> _function = new Procedure1<Attribute>() {
+ final Consumer<Attribute> _function = new Consumer<Attribute>() {
@Override
- public void apply(final Attribute a) {
+ public void accept(final Attribute a) {
RefableType _type = a.getType();
DataType _type_1 = _type.getType();
boolean _isDataClass = VariableServiceGen.this._typeHelpers.isDataClass(_type_1);
@@ -580,10 +580,10 @@ public class VariableServiceGen {
}
}
};
- IterableExtensions.<Attribute>forEach(_dynConfigReadAttributes, _function);
+ _dynConfigReadAttributes.forEach(_function);
}
};
- IterableExtensions.<ActorInstance>forEach(ais, _function);
+ ais.forEach(_function);
return result;
}
@@ -596,9 +596,9 @@ public class VariableServiceGen {
{
DataClass dc = visit.pop();
List<Attribute> _allAttributes = this._roomHelpers.getAllAttributes(dc);
- final Procedure1<Attribute> _function = new Procedure1<Attribute>() {
+ final Consumer<Attribute> _function = new Consumer<Attribute>() {
@Override
- public void apply(final Attribute a) {
+ public void accept(final Attribute a) {
RefableType _type = a.getType();
DataType _type_1 = _type.getType();
boolean _isDataClass = VariableServiceGen.this._typeHelpers.isDataClass(_type_1);
@@ -609,7 +609,7 @@ public class VariableServiceGen {
}
}
};
- IterableExtensions.<Attribute>forEach(_allAttributes, _function);
+ _allAttributes.forEach(_function);
}
}
return result;
@@ -617,15 +617,15 @@ public class VariableServiceGen {
private HashSet<RoomModel> getRoomModels(final Collection<ActorInstance> ais) {
final HashSet<RoomModel> models = new HashSet<RoomModel>();
- final Procedure1<ActorInstance> _function = new Procedure1<ActorInstance>() {
+ final Consumer<ActorInstance> _function = new Consumer<ActorInstance>() {
@Override
- public void apply(final ActorInstance ai) {
+ public void accept(final ActorInstance ai) {
ActorClass _actorClass = ai.getActorClass();
EObject _eContainer = _actorClass.eContainer();
models.add(((RoomModel) _eContainer));
}
};
- IterableExtensions.<ActorInstance>forEach(ais, _function);
+ ais.forEach(_function);
return models;
}
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java
index 5ac6a98f8..4004a1254 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java
@@ -137,11 +137,8 @@ public class GenericStateMachineGenerator extends AbstractStateMachineGenerator
{
TransitionBase _transition = tt.getTransition();
EList<Trigger> _triggers = ((TriggeredTransition) _transition).getTriggers();
- final Function1<Trigger, Boolean> _function = new Function1<Trigger, Boolean>() {
- @Override
- public Boolean apply(final Trigger trig) {
- return Boolean.valueOf(GenericStateMachineGenerator.this._triggerExtensions.isMatching(trig, trigger));
- }
+ final Function1<Trigger, Boolean> _function = (Trigger trig) -> {
+ return Boolean.valueOf(this._triggerExtensions.isMatching(trig, trigger));
};
final Trigger tr = IterableExtensions.<Trigger>findFirst(_triggers, _function);
StringConcatenation _builder = new StringConcatenation();
@@ -177,12 +174,9 @@ public class GenericStateMachineGenerator extends AbstractStateMachineGenerator
public String genActionCodeMethod(final GraphContainer gc, final Link link, final boolean generateImplementation) {
String _xblockexpression = null;
{
- boolean hasArgs = ((!link.getChainHeads().isEmpty()) && IterableExtensions.<Link>forall(link.getChainHeads(), new Function1<Link, Boolean>() {
- @Override
- public Boolean apply(final Link it) {
- return Boolean.valueOf(((it.getTransition() instanceof NonInitialTransition) && (!(it.getTransition() instanceof GuardedTransition))));
- }
- }));
+ boolean hasArgs = ((!link.getChainHeads().isEmpty()) && IterableExtensions.<Link>forall(link.getChainHeads(), ((Function1<Link, Boolean>) (Link it) -> {
+ return Boolean.valueOf(((it.getTransition() instanceof NonInitialTransition) && (!(it.getTransition() instanceof GuardedTransition))));
+ })));
String _className = this.getClassName(gc);
final String opScope = this.langExt.operationScope(_className, false);
String _xifexpression = null;
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java
index e8698f6ec..e7f882e20 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java
@@ -388,14 +388,11 @@ public class ProcedureHelpers {
* @return an argument list for the attributes
*/
public String argList(final Iterable<Attribute> attributes) {
- final Function1<Attribute, String> _function = new Function1<Attribute, String>() {
- @Override
- public String apply(final Attribute it) {
- String _signatureString = ProcedureHelpers.this.signatureString(it);
- String _plus = (_signatureString + " ");
- String _name = it.getName();
- return (_plus + _name);
- }
+ final Function1<Attribute, String> _function = (Attribute it) -> {
+ String _signatureString = this.signatureString(it);
+ String _plus = (_signatureString + " ");
+ String _name = it.getName();
+ return (_plus + _name);
};
Iterable<String> _map = IterableExtensions.<Attribute, String>map(attributes, _function);
return IterableExtensions.join(_map, ", ");
@@ -561,12 +558,9 @@ public class ProcedureHelpers {
boolean _usesInheritance = this.languageExt.usesInheritance();
boolean _not = (!_usesInheritance);
List<ClassStructor> _structors = this.getStructors(cls, _not);
- final Function1<ClassStructor, Boolean> _function = new Function1<ClassStructor, Boolean>() {
- @Override
- public Boolean apply(final ClassStructor it) {
- boolean _isConstructor = it.isConstructor();
- return Boolean.valueOf((_isConstructor == ctor));
- }
+ final Function1<ClassStructor, Boolean> _function = (ClassStructor it) -> {
+ boolean _isConstructor = it.isConstructor();
+ return Boolean.valueOf((_isConstructor == ctor));
};
boolean _exists = IterableExtensions.<ClassStructor>exists(_structors, _function);
if (_exists) {
@@ -603,11 +597,8 @@ public class ProcedureHelpers {
boolean _usesInheritance = this.languageExt.usesInheritance();
boolean _not = (!_usesInheritance);
List<ClassStructor> _structors = this.getStructors(cls, _not);
- final Function1<ClassStructor, Boolean> _function = new Function1<ClassStructor, Boolean>() {
- @Override
- public Boolean apply(final ClassStructor it) {
- return Boolean.valueOf(it.isConstructor());
- }
+ final Function1<ClassStructor, Boolean> _function = (ClassStructor it) -> {
+ return Boolean.valueOf(it.isConstructor());
};
boolean _exists = IterableExtensions.<ClassStructor>exists(_structors, _function);
if (_exists) {
@@ -619,12 +610,9 @@ public class ProcedureHelpers {
boolean _usesInheritance_1 = this.languageExt.usesInheritance();
boolean _not_1 = (!_usesInheritance_1);
List<ClassStructor> _structors_1 = this.getStructors(cls, _not_1);
- final Function1<ClassStructor, Boolean> _function_1 = new Function1<ClassStructor, Boolean>() {
- @Override
- public Boolean apply(final ClassStructor it) {
- boolean _isConstructor = it.isConstructor();
- return Boolean.valueOf((!_isConstructor));
- }
+ final Function1<ClassStructor, Boolean> _function_1 = (ClassStructor it) -> {
+ boolean _isConstructor = it.isConstructor();
+ return Boolean.valueOf((!_isConstructor));
};
boolean _exists_1 = IterableExtensions.<ClassStructor>exists(_structors_1, _function_1);
if (_exists_1) {
@@ -666,12 +654,9 @@ public class ProcedureHelpers {
boolean _usesInheritance = this.languageExt.usesInheritance();
boolean _not = (!_usesInheritance);
List<ClassStructor> _structors = this.getStructors(cls, _not);
- final Function1<ClassStructor, Boolean> _function = new Function1<ClassStructor, Boolean>() {
- @Override
- public Boolean apply(final ClassStructor it) {
- boolean _isConstructor = it.isConstructor();
- return Boolean.valueOf((_isConstructor == ctor));
- }
+ final Function1<ClassStructor, Boolean> _function = (ClassStructor it) -> {
+ boolean _isConstructor = it.isConstructor();
+ return Boolean.valueOf((_isConstructor == ctor));
};
boolean _exists = IterableExtensions.<ClassStructor>exists(_structors, _function);
boolean _not_1 = (!_exists);
@@ -720,42 +705,30 @@ public class ProcedureHelpers {
boolean _usesInheritance = this.languageExt.usesInheritance();
boolean _not = (!_usesInheritance);
List<ClassStructor> _structors = this.getStructors(cls, _not);
- final Function1<ClassStructor, Boolean> _function = new Function1<ClassStructor, Boolean>() {
- @Override
- public Boolean apply(final ClassStructor it) {
- boolean _isConstructor = it.isConstructor();
- return Boolean.valueOf((_isConstructor == ctor));
- }
+ final Function1<ClassStructor, Boolean> _function = (ClassStructor it) -> {
+ boolean _isConstructor = it.isConstructor();
+ return Boolean.valueOf((_isConstructor == ctor));
};
final Iterable<ClassStructor> implementedStructors = IterableExtensions.<ClassStructor>filter(_structors, _function);
- final Function1<ClassStructor, DetailCode> _function_1 = new Function1<ClassStructor, DetailCode>() {
- @Override
- public DetailCode apply(final ClassStructor it) {
- return it.getDetailCode();
- }
+ final Function1<ClassStructor, DetailCode> _function_1 = (ClassStructor it) -> {
+ return it.getDetailCode();
};
Iterable<DetailCode> _map = IterableExtensions.<ClassStructor, DetailCode>map(implementedStructors, _function_1);
- final Function1<DetailCode, String> _function_2 = new Function1<DetailCode, String>() {
- @Override
- public String apply(final DetailCode it) {
- AbstractGenerator _instance = AbstractGenerator.getInstance();
- return _instance.getTranslatedCode(it);
- }
+ final Function1<DetailCode, String> _function_2 = (DetailCode it) -> {
+ AbstractGenerator _instance = AbstractGenerator.getInstance();
+ return _instance.getTranslatedCode(it);
};
final Iterable<String> translatedCodes = IterableExtensions.<DetailCode, String>map(_map, _function_2);
- final Function1<String, CharSequence> _function_3 = new Function1<String, CharSequence>() {
- @Override
- public CharSequence apply(final String it) {
- CharSequence _xifexpression = null;
- int _size = IterableExtensions.size(translatedCodes);
- boolean _greaterThan = (_size > 1);
- if (_greaterThan) {
- _xifexpression = ProcedureHelpers.this.asBlock(it);
- } else {
- _xifexpression = it;
- }
- return _xifexpression;
+ final Function1<String, CharSequence> _function_3 = (String it) -> {
+ CharSequence _xifexpression = null;
+ int _size = IterableExtensions.size(translatedCodes);
+ boolean _greaterThan = (_size > 1);
+ if (_greaterThan) {
+ _xifexpression = this.asBlock(it);
+ } else {
+ _xifexpression = it;
}
+ return _xifexpression;
};
Iterable<CharSequence> _map_1 = IterableExtensions.<String, CharSequence>map(translatedCodes, _function_3);
String _join = IterableExtensions.join(_map_1);
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java
index 1095bc38b..730f7758f 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java
@@ -17,6 +17,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.function.Consumer;
import javax.inject.Inject;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
@@ -51,7 +52,6 @@ import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
/**
* collection of convenience functions for code generation
@@ -103,14 +103,11 @@ public class RoomExtensions extends FSMExtensions {
*/
public List<Port> punion(final Iterable<Port> in1, final Iterable<ExternalPort> in2) {
final ArrayList<Port> ret = new ArrayList<Port>();
- final Procedure1<ExternalPort> _function = new Procedure1<ExternalPort>() {
- @Override
- public void apply(final ExternalPort e) {
- Port _interfacePort = e.getInterfacePort();
- ret.add(_interfacePort);
- }
+ final Consumer<ExternalPort> _function = (ExternalPort e) -> {
+ Port _interfacePort = e.getInterfacePort();
+ ret.add(_interfacePort);
};
- IterableExtensions.<ExternalPort>forEach(in2, _function);
+ in2.forEach(_function);
Iterables.<Port>addAll(ret, in1);
return ret;
}
@@ -561,12 +558,9 @@ public class RoomExtensions extends FSMExtensions {
public MessageHandler getSendHandler(final Message m, final boolean conj) {
EObject _eContainer = m.eContainer();
List<MessageHandler> _sendHandlers = this.getSendHandlers(((ProtocolClass) _eContainer), conj);
- final Function1<MessageHandler, Boolean> _function = new Function1<MessageHandler, Boolean>() {
- @Override
- public Boolean apply(final MessageHandler e) {
- Message _msg = e.getMsg();
- return Boolean.valueOf(Objects.equal(_msg, m));
- }
+ final Function1<MessageHandler, Boolean> _function = (MessageHandler e) -> {
+ Message _msg = e.getMsg();
+ return Boolean.valueOf(Objects.equal(_msg, m));
};
return IterableExtensions.<MessageHandler>findFirst(_sendHandlers, _function);
}
@@ -603,12 +597,9 @@ public class RoomExtensions extends FSMExtensions {
* void return type
*/
public boolean overridesStop(final ActorClass ac) {
- return (IterableExtensions.<StandardOperation>exists(ac.getOperations(), new Function1<StandardOperation, Boolean>() {
- @Override
- public Boolean apply(final StandardOperation e) {
- return Boolean.valueOf(((Objects.equal(e.getName(), "stop") && e.getArguments().isEmpty()) && Objects.equal(e.getReturnType(), null)));
- }
- }) || ((!Objects.equal(ac.getActorBase(), null)) && this.overridesStop(ac.getActorBase())));
+ return (IterableExtensions.<StandardOperation>exists(ac.getOperations(), ((Function1<StandardOperation, Boolean>) (StandardOperation e) -> {
+ return Boolean.valueOf(((Objects.equal(e.getName(), "stop") && e.getArguments().isEmpty()) && Objects.equal(e.getReturnType(), null)));
+ })) || ((!Objects.equal(ac.getActorBase(), null)) && this.overridesStop(ac.getActorBase())));
}
public BasicEList<AbstractInstance> getAllSubInstances(final StructureInstance ssi) {
diff --git a/plugins/org.eclipse.etrice.ui.behavior/xtend-gen/org/eclipse/etrice/ui/behavior/detailcode/DefaultDetailExpressionProvider.java b/plugins/org.eclipse.etrice.ui.behavior/xtend-gen/org/eclipse/etrice/ui/behavior/detailcode/DefaultDetailExpressionProvider.java
index 81e83705e..35662a4d8 100644
--- a/plugins/org.eclipse.etrice.ui.behavior/xtend-gen/org/eclipse/etrice/ui/behavior/detailcode/DefaultDetailExpressionProvider.java
+++ b/plugins/org.eclipse.etrice.ui.behavior/xtend-gen/org/eclipse/etrice/ui/behavior/detailcode/DefaultDetailExpressionProvider.java
@@ -13,6 +13,7 @@ package org.eclipse.etrice.ui.behavior.detailcode;
import com.google.common.base.Objects;
import com.google.common.collect.Iterables;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.Attribute;
import org.eclipse.etrice.core.room.CommunicationType;
@@ -32,9 +33,7 @@ import org.eclipse.etrice.ui.behavior.fsm.detailcode.IDetailExpressionProvider;
import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.ListExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
/**
* Defines expression for fsm detail code of an ActorClass
@@ -51,9 +50,9 @@ public class DefaultDetailExpressionProvider extends GuardDetailExpressionProvid
scope.add(_createExprFeature);
}
List<InterfaceItem> _allInterfaceItems = this.roomHelpers.getAllInterfaceItems(this.actorClass);
- final Procedure1<InterfaceItem> _function = new Procedure1<InterfaceItem>() {
+ final Consumer<InterfaceItem> _function = new Consumer<InterfaceItem>() {
@Override
- public void apply(final InterfaceItem it) {
+ public void accept(final InterfaceItem it) {
boolean _matched = false;
if (it instanceof SPP) {
boolean _isEventDriven = ((SPP)it).isEventDriven();
@@ -97,7 +96,7 @@ public class DefaultDetailExpressionProvider extends GuardDetailExpressionProvid
}
}
};
- IterableExtensions.<InterfaceItem>forEach(_allInterfaceItems, _function);
+ _allInterfaceItems.forEach(_function);
List<StandardOperation> _latestOperations = this.roomHelpers.getLatestOperations(this.actorClass);
final Function1<StandardOperation, IDetailExpressionProvider.ExpressionFeature> _function_1 = new Function1<StandardOperation, IDetailExpressionProvider.ExpressionFeature>() {
@Override
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend
index 5e0975af4..bb12a3ab7 100644
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend
@@ -42,6 +42,7 @@ class TestHierInheritedFSM extends FsmGenTestBase {
assertFalse("logger has no errors", logger.hasErrors)
save(gc, "HierInheritedFSMExample")
+ save(gc2, "HierInheritedFSMExample2")
}
@Test
@@ -75,7 +76,7 @@ class TestHierInheritedFSM extends FsmGenTestBase {
def void testOriginRefs() {
gc2.graph.nodes.filter[stateGraphNode.name == 'state0'] => [
assertEquals(1, size)
- assertEquals('RefinedState:TestActor$state0', EcoreUtil.getURI(head.stateGraphNode).fragment)
+ assertEquals('RefinedState:TestActor2$state0', EcoreUtil.getURI(head.stateGraphNode).fragment)
]
gc2.graph.links.filter[transition.name == 'tr3'] => [
assertEquals(1, size)
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.java
index 1ed8dd1d7..2aaefb176 100644
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.java
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.java
@@ -53,6 +53,7 @@ public class TestHierInheritedFSM extends FsmGenTestBase {
boolean _hasErrors = logger.hasErrors();
Assert.assertFalse("logger has no errors", _hasErrors);
this.save(this.gc, "HierInheritedFSMExample");
+ this.save(this.gc2, "HierInheritedFSMExample2");
}
@Test
@@ -147,7 +148,7 @@ public class TestHierInheritedFSM extends FsmGenTestBase {
StateGraphNode _stateGraphNode = _head.getStateGraphNode();
URI _uRI = EcoreUtil.getURI(_stateGraphNode);
String _fragment = _uRI.fragment();
- Assert.assertEquals("RefinedState:TestActor$state0", _fragment);
+ Assert.assertEquals("RefinedState:TestActor2$state0", _fragment);
}
};
ObjectExtensions.<Iterable<Node>>operator_doubleArrow(_filter, _function_1);

Back to the top