Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Jvm Generation using setBody in 2.3.0m6(Did the way to use setBody change?)
Jvm Generation using setBody in 2.3.0m6 [message #841926] Wed, 11 April 2012 21:32 Go to next message
Jens-Uwe Moeller is currently offline Jens-Uwe MoellerFriend
Messages: 12
Registered: March 2012
Location: Hamburg
Junior Member
Hi,

I used the following code in an infer-Rule of my JvmModelInferrer:

val strType = typeReferences.createTypeRef(typeReferences.findDeclaredType("java.lang.String", e))

members += e.toMethod("myStringAppend", strType) [
	it.parameters += it.toParameter("inString", strType)
	it.setBody [ '''String x = inString + "created by a the useless myStringAppend";
		return x;
		''' ]
]


This workes fine with xtext 2.2.1 but results in an empty method body in 2.3.0m6:
  public String myStringAppend(final String inString) {
    
  }

Am I doing something wrong, did you change the way how to use setBody or is this a bug?
Re: Jvm Generation using setBody in 2.3.0m6 [message #842854 is a reply to message #841926] Thu, 12 April 2012 17:15 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
did you try something like

it.setBody [ it.append('''String x = inString + "created by a the useless myStringAppend";
		return x;
		''' )]


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:extension point for Xtext 2.3M6 generated outline view
Next Topic:How can I check feature assignment is ok?
Goto Forum:
  


Current Time: Tue Apr 16 08:53:46 GMT 2024

Powered by FUDForum. Page generated in 0.05629 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top