Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319664

Summary: NPE when tyring to find most specific template for <null>
Product: [Modeling] Acceleo Reporter: Mikaël Barbero <mikael.barbero>
Component: CoreAssignee: Project Inbox <acceleo-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: mikael.barbero, stephane.begaudeau
Version: 3.0.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Mikaël Barbero CLA 2010-07-13 03:44:22 EDT
Hello,

AcceleoEvaluationEnvironment#getMostSpecificTemplate(List<Template>, List<Object>) may throw a NPE when null is provided in arguments list (second parameter).

For instance, within a UML model, I have a template called "gen"

[template public gen(e : Property)]
[type.referenceName()/] [name()/];
[/template]

[template public referenceName(e : PrimitiveType)]
p_[name/]
[/template]

[template public referenceName(e : DataType)]
d_[name/]
[/template]

NPE occurs when trying to find the best referenceName template to call rather than when simply calling referenceName(self.type) in "gen". I'd better see an OclUndefined exception ("can not call referenceName on <OclUndefined>") or something like this before the getMostSpecificTemplate().

Best regards,
Mika
Comment 1 Stephane Begaudeau CLA 2010-09-10 08:37:24 EDT

*** This bug has been marked as a duplicate of bug 290532 ***