Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-07-09 10:12:30 +0000
committerHenrik Rentz-Reichert2012-07-09 10:12:30 +0000
commita85775304b28d91e08080e03c28a27f6d0882447 (patch)
treebbd091fa3988d928d8c472a018525fd9237ec68b
parent2bbe037335b4ddb4b6fdbccb09dd9e6365483e26 (diff)
downloadorg.eclipse.etrice-a85775304b28d91e08080e03c28a27f6d0882447.tar.gz
org.eclipse.etrice-a85775304b28d91e08080e03c28a27f6d0882447.tar.xz
org.eclipse.etrice-a85775304b28d91e08080e03c28a27f6d0882447.zip
[generator.c] bug 381211: not connected repl port generates not compile clean code (C-Generator)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=381211
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java11
2 files changed, 11 insertions, 2 deletions
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend
index cb15fe9a1..43cd9f08e 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend
@@ -353,7 +353,7 @@ class SubSystemClassGen {
«IF haveReplSubPorts»
static const etReplSubPort «replSubPortsArray»[«offset»] = {
/* Replicated Sub Ports: {varData, msgService, peerAddress, localId, index} */
- «FOR pi : replPorts SEPARATOR ","»
+ «FOR pi : replPorts.filter(e|!e.peers.empty) SEPARATOR ","»
«genReplSubPortInitializers(root, ai, pi)»
«ENDFOR»
};
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java
index 6ba2c9d02..cf257f39f 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java
@@ -1035,8 +1035,17 @@ public class SubSystemClassGen {
_builder.append("/* Replicated Sub Ports: {varData, msgService, peerAddress, localId, index} */");
_builder.newLine();
{
+ final Function1<InterfaceItemInstance,Boolean> _function_7 = new Function1<InterfaceItemInstance,Boolean>() {
+ public Boolean apply(final InterfaceItemInstance e) {
+ EList<InterfaceItemInstance> _peers = e.getPeers();
+ boolean _isEmpty = _peers.isEmpty();
+ boolean _operator_not = BooleanExtensions.operator_not(_isEmpty);
+ return ((Boolean)_operator_not);
+ }
+ };
+ Iterable<InterfaceItemInstance> _filter_6 = IterableExtensions.<InterfaceItemInstance>filter(replPorts, _function_7);
boolean hasAnyElements = false;
- for(final InterfaceItemInstance pi : replPorts) {
+ for(final InterfaceItemInstance pi : _filter_6) {
if (!hasAnyElements) {
hasAnyElements = true;
} else {

Back to the top