Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Problem by passing null to a template
[Acceleo] Problem by passing null to a template [message #607721] Tue, 21 September 2010 16:13 Go to next message
Eclipse UserFriend
I am using acceleo with dynamic template detection. I invoke it this way:

[generate(type.attribute)/]


The generate Template is defined like this:
[template generate(x : TypeA)] .... [/template]
[template generate(x : TypeB)] .... [/template]


in my case, type.attribute can be either there or not, as it is optional. I do have many of such cases in my code.

When this is executed and this is null, then it throws a NullPointerException during the template detection algorithm. Could I configure it that this just fails silently and this precise statement doesn't have an output? If not, I have to provide always the same code for checking if the variable is there and if not, then do not execute this.

An additional problem is, that by having this null pointer exception, the point of the error is almost impossible to find from the error statement as no line is given at which this is invoked. ...
Re: [Acceleo] Problem by passing null to a template [message #624951 is a reply to message #607721] Wed, 22 September 2010 02:32 Go to previous messageGo to next message
Eclipse UserFriend
Hi Simon,

This was a known issue up till the latest Acceleo builds, yet it has been resolved since (see also https://bugs.eclipse.org/bugs/show_bug.cgi?id=290532 ).

Eclipse 3.6.1 is due out at the end of the week. The Acceleo version shipped with this service release, 3.0.1, fixes the NPE you encounter.
Re: [Acceleo] Problem by passing null to a template [message #625914 is a reply to message #607721] Wed, 22 September 2010 07:01 Go to previous message
Eclipse UserFriend
Excellent. Keep up the good work.
Previous Topic:[Xpand] 3.4 update site's errors
Next Topic:[xtend] bidrectional references not set with two ecore models
Goto Forum:
  


Current Time: Wed Jul 02 16:26:37 EDT 2025

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

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

Back to the top