diff options
author | Henrik Rentz-Reichert | 2015-04-20 06:32:41 +0000 |
---|---|---|
committer | Henrik Rentz-Reichert | 2015-04-20 06:32:41 +0000 |
commit | cacf5e93820a0c9b4f9c4e4ace85d0ca2b31c98c (patch) | |
tree | a08aecfa4aced3963830b45a46bef662e6f830ce /plugins | |
parent | ecbf1d90f5016c4a6424bb5bd4393a13255972a0 (diff) | |
download | org.eclipse.etrice-cacf5e93820a0c9b4f9c4e4ace85d0ca2b31c98c.tar.gz org.eclipse.etrice-cacf5e93820a0c9b4f9c4e4ace85d0ca2b31c98c.tar.xz org.eclipse.etrice-cacf5e93820a0c9b4f9c4e4ace85d0ca2b31c98c.zip |
[generator.java] removed duplicate method generation in case of async or
data driven with FSM
Change-Id: I18aa4971f03f40b87a89747c2e1c3909394d197c
Diffstat (limited to 'plugins')
2 files changed, 14 insertions, 58 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend index c9e19c138..3ac56c6c7 100644 --- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend +++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend @@ -303,7 +303,11 @@ class ActorClassGen extends GenericActorClassGenerator { «IF ac.commType == ComponentCommunicationType::ASYNCHRONOUS || ac.commType == ComponentCommunicationType::DATA_DRIVEN» @Override public void receive(Message msg) { - receiveEvent(«IF ac.commType == ComponentCommunicationType::ASYNCHRONOUS»null, -1, null«ENDIF»); + «IF ac.commType == ComponentCommunicationType::ASYNCHRONOUS» + receiveEvent(null, -1, null); + «ELSE» + receiveEventInternal(); + «ENDIF» } «ENDIF» «ELSEIF xpac.stateMachine.empty» @@ -317,17 +321,6 @@ class ActorClassGen extends GenericActorClassGenerator { «ENDIF» «ENDIF» - «IF ac.commType == ComponentCommunicationType::ASYNCHRONOUS || ac.commType == ComponentCommunicationType::DATA_DRIVEN» - @Override - public void receive(Message msg) { - «IF ac.commType == ComponentCommunicationType::ASYNCHRONOUS» - receiveEvent(null, -1, null); - «ELSE» - receiveEventInternal(); - «ENDIF» - } - «ENDIF» - «IF Main::settings.generatePersistenceInterface» @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 975fef86f..81acb138d 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 @@ -1149,18 +1149,21 @@ public class ActorClassGen extends GenericActorClassGenerator { _builder.append("\t"); _builder.append("public void receive(Message msg) {"); _builder.newLine(); - _builder.append("\t"); - _builder.append("\t"); - _builder.append("receiveEvent("); { ComponentCommunicationType _commType_7 = ac.getCommType(); boolean _equals_8 = Objects.equal(_commType_7, ComponentCommunicationType.ASYNCHRONOUS); if (_equals_8) { - _builder.append("null, -1, null"); + _builder.append("\t"); + _builder.append("\t"); + _builder.append("receiveEvent(null, -1, null);"); + _builder.newLine(); + } else { + _builder.append("\t"); + _builder.append("\t"); + _builder.append("receiveEventInternal();"); + _builder.newLine(); } } - _builder.append(");"); - _builder.newLineIfNotEmpty(); _builder.append("\t"); _builder.append("}"); _builder.newLine(); @@ -1196,46 +1199,6 @@ public class ActorClassGen extends GenericActorClassGenerator { _builder.append("\t"); _builder.newLine(); { - boolean _or_5 = false; - ComponentCommunicationType _commType_8 = ac.getCommType(); - boolean _equals_9 = Objects.equal(_commType_8, ComponentCommunicationType.ASYNCHRONOUS); - if (_equals_9) { - _or_5 = true; - } else { - ComponentCommunicationType _commType_9 = ac.getCommType(); - boolean _equals_10 = Objects.equal(_commType_9, ComponentCommunicationType.DATA_DRIVEN); - _or_5 = _equals_10; - } - if (_or_5) { - _builder.append("\t"); - _builder.append("@Override"); - _builder.newLine(); - _builder.append("\t"); - _builder.append("public void receive(Message msg) {"); - _builder.newLine(); - { - ComponentCommunicationType _commType_10 = ac.getCommType(); - boolean _equals_11 = Objects.equal(_commType_10, ComponentCommunicationType.ASYNCHRONOUS); - if (_equals_11) { - _builder.append("\t"); - _builder.append("\t"); - _builder.append("receiveEvent(null, -1, null);"); - _builder.newLine(); - } else { - _builder.append("\t"); - _builder.append("\t"); - _builder.append("receiveEventInternal();"); - _builder.newLine(); - } - } - _builder.append("\t"); - _builder.append("}"); - _builder.newLine(); - } - } - _builder.append("\t"); - _builder.newLine(); - { GlobalSettings _settings_8 = Main.getSettings(); boolean _isGeneratePersistenceInterface_2 = _settings_8.isGeneratePersistenceInterface(); if (_isGeneratePersistenceInterface_2) { |