Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319664 - NPE when tyring to find most specific template for <null>
Summary: NPE when tyring to find most specific template for <null>
Status: CLOSED DUPLICATE of bug 290532
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.0   Edit
Hardware: All All
: P3 major
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-13 03:44 EDT by Mikaël Barbero CLA
Modified: 2010-09-10 08:37 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***