Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362056 - [traceability] ClassCastException with guards
Summary: [traceability] ClassCastException with guards
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 critical
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-26 08:10 EDT by Stephane Begaudeau CLA
Modified: 2015-05-27 08:56 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephane Begaudeau CLA 2011-10-26 08:10:42 EDT
A ClassCastException can occur with the traceability engine on a template like this:

[template public myTemplate (c: Class) ?(c.eAllContents()->filter()->size() > 0)]
[/template]

Something, somewhere in the evaluation of the guard is causing a NPE that returns a DynamicEObjectImpl that cannot be casted in a java.lang.Boolean.

A unit test highlighting the problem has been contributed on master.
Comment 1 Stephane Begaudeau CLA 2011-10-26 09:18:34 EDT
The problem is coming from the evaluation of the guard on a main template.

the fix for the class cast exception has been contributed with a fix for the evaluation of the guard of a main template.

The fix have been contributed on master and will be available in Acceleo 3.2+ (not 3.2.0 since we are to close from the release and a simple workaround is available: do not use the guard on the main template with the traceability engine but use it on another template later and the guard on a main template do not match the good practices for an Acceleo generator).
Comment 2 Laurent Goubet CLA 2015-05-27 08:56:09 EDT
Closing resolved bugs