Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 20:13 Go to next message
Simon harrer is currently offline Simon harrerFriend
Messages: 25
Registered: August 2010
Junior Member
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 06:32 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
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 11:01 Go to previous message
Simon harrer is currently offline Simon harrerFriend
Messages: 25
Registered: August 2010
Junior Member
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: Thu Apr 25 09:37:42 GMT 2024

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

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

Back to the top