Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Xcore] produces non-compiling Java code when using closures
[Xcore] produces non-compiling Java code when using closures [message #965783] Wed, 31 October 2012 13:58 Go to next message
Nicolas Cabanis is currently offline Nicolas CabanisFriend
Messages: 14
Registered: July 2009
Junior Member
Hello,

I am referring to http://wiki.eclipse.org/Xcore # Specifying an Operation.

Assume the following method is added to the Library class:
   op Book[] findBooksByAuthor (Author author) {
      return authors.filter [it == author].toList
   }


produces two problems:
1.) an EList is expected instead of List
2.) the generated code contains an anonymous inner class and the "author" param is not final

Regards,
Nicolas
Re: [Xcore] produces non-compiling Java code when using closures [message #965809 is a reply to message #965783] Wed, 31 October 2012 14:14 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26237
Registered: July 2009
Senior Member
Nicolas,

All the parameters should be final in the recent nightly builds. These
builds also include support for extension methods, so you can write toEList.


On 31/10/2012 2:58 PM, Nicolas Cabanis wrote:
> Hello,
>
> I am referring to http://wiki.eclipse.org/Xcore # Specifying an
> Operation.
>
> Assume the following method is added to the Library class:
>
> op Book[] findBooksByAuthor (Author author) {
> return authors.filter [it == author].toList
> }
>
>
> produces two problems:
> 1.) an EList is expected instead of List
> 2.) the generated code contains an anonymous inner class and the
> "author" param is not final
>
> Regards,
> Nicolas
Previous Topic:[TEXO] ModelXMLLoader mapping
Next Topic:Get the selected menu item
Goto Forum:
  


Current Time: Sat Nov 29 05:45:20 GMT 2014

Powered by FUDForum. Page generated in 0.03293 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software