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

Bug 344454

Summary: [Xbase] nesting closures leads to 'Cannot refer to a non-final variable' compiler error in generated Java code
Product: [Modeling] TMF Reporter: Jendrik Johannes <jendrik.johannes>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sven.efftinge
Version: unspecifiedFlags: sven.efftinge: indigo+
Target Milestone: M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Jendrik Johannes CLA 2011-05-02 09:35:24 EDT
Build Identifier: 2.0.0.v201105010942	

Example:

newArrayList('1').filter(e|newArrayList('1').filter(f | f == e) == null)

leads to the following compiler error:

"Cannot refer to a non-final variable e inside an inner class defined in a different method"

The parameters of the generated apply() methods probably need to be final.


Reproducible: Always
Comment 1 Sven Efftinge CLA 2011-05-02 09:56:25 EDT
pushed to master
Comment 2 Karsten Thoms CLA 2017-09-19 18:08:33 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 18:17:58 EDT
Closing all bugs that were set to RESOLVED before Neon.0