Skip to main content


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: 15
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: 33140
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[TEXO] ModelXMLLoader mapping
Next Topic:Get the selected menu item
Goto Forum:
  


Current Time: Thu Apr 25 09:55:45 GMT 2024

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

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

Back to the top