Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-01-09 16:26:54 +0000
committerHenrik Rentz-Reichert2012-01-09 16:26:54 +0000
commit84e965103b17a8ff32b27581244d261bbb34ee04 (patch)
treeb2e96c271fc5c6943b4a01b8b4f269734ff86bbd /plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
parent8728141393eaf7c98ea8bf94f57693b81c996b52 (diff)
downloadorg.eclipse.etrice-84e965103b17a8ff32b27581244d261bbb34ee04.tar.gz
org.eclipse.etrice-84e965103b17a8ff32b27581244d261bbb34ee04.tar.xz
org.eclipse.etrice-84e965103b17a8ff32b27581244d261bbb34ee04.zip
[generator, generator.java] bug fixes in types
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend')
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
index 9cc113005..ee1b2fa66 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
@@ -16,12 +16,14 @@ import com.google.inject.Inject
import com.google.inject.Singleton
import org.eclipse.etrice.core.room.Message
import org.eclipse.etrice.core.room.ProtocolClass
+import org.eclipse.etrice.core.room.PrimitiveType
import org.eclipse.etrice.generator.base.ILogger
import org.eclipse.etrice.generator.etricegen.Root
import org.eclipse.xtext.generator.JavaIoFileSystemAccess
import org.eclipse.etrice.generator.extensions.RoomExtensions
import org.eclipse.etrice.generator.generic.ProcedureHelpers
+import org.eclipse.etrice.generator.generic.TypeHelpers
@Singleton
@@ -31,6 +33,7 @@ class ProtocolClassGen {
@Inject extension JavaExtensions stdExt
@Inject extension RoomExtensions roomExt
@Inject extension ProcedureHelpers helpers
+ @Inject extension TypeHelpers
@Inject ILogger logger
def doGenerate(Root root) {
@@ -225,7 +228,7 @@ class ProtocolClassGen {
def messageSignature(Message m) {
'''
- public void «m.name» («IF m.data!=null»«m.data.type.name» «m.data.name»«ENDIF»)
+ public void «m.name» («IF m.data!=null»«m.data.type.typeName» «m.data.name»«ENDIF»)
'''
}
@@ -249,7 +252,7 @@ class ProtocolClassGen {
}
if (getPeerAddress()!=null)
«IF m.data==null»getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), «dir»_«m.name»));
- «ELSE»getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), «dir»_«m.name», «m.data.name»«IF (!m.data.ref)».deepCopy()«ENDIF»));
+ «ELSE»getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), «dir»_«m.name», «m.data.name»«IF (!m.data.ref && !(m.data.type instanceof PrimitiveType))».deepCopy()«ENDIF»));
«ENDIF»
«ENDIF»
}

Back to the top