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

Bug 327649

Summary: List with null values is evaluated to inner type Void
Product: [Modeling] M2T Reporter: Steffen Stundzig <stundzig>
Component: XpandAssignee: Project Inbox <m2t.xpand-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: karsten.thoms
Version: unspecifiedFlags: karsten.thoms: kepler+
Target Milestone: M4   
Hardware: All   
OS: All   
Whiteboard:

Description Steffen Stundzig CLA 2010-10-13 07:44:24 EDT
If i've traverse a collection with elements and access a property which returns null, the next calls to the elements in this list breaks the workflow.

For example:

MyListProperty.ThePropertyWhichIsNullForAllElementsInTheList.shortName;

causes a:

AbstractExpressionsUsingWorkflowComponent - Error in Component  of type org.eclipse.xpand2.Generator: 
	EvaluationException : Couldn't find property 'shortName' for inner type Void'

As workaround I can use:

MyListProperty.ThePropertyWhichIsNullForAllElementsInTheList.collect(e|e.shortName);

which returns the List with null-Elements. But this should be the default behaviour also in short Syntax as in the example above.
Comment 1 Karsten Thoms CLA 2012-10-31 07:35:35 EDT
Fixed with bug#386253

Added test case EvaluationTest#testFeatureCallReturningNull()

*** This bug has been marked as a duplicate of bug 386253 ***
Comment 2 Karsten Thoms CLA 2013-02-07 06:16:13 EST
Part of Kepler M4 (Version 1.3.0)
Comment 3 Eclipse Webmaster CLA 2017-10-31 10:48:41 EDT
Requested via bug 522520.

-M.
Comment 4 Eclipse Webmaster CLA 2017-10-31 10:59:43 EDT
Requested via bug 522520.

-M.