Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Cannot add an Inheritance from a new EClass to an EClass imported from another ecore
Cannot add an Inheritance from a new EClass to an EClass imported from another ecore [message #1141897] Thu, 17 October 2013 09:02 Go to next message
Marco Liberati is currently offline Marco LiberatiFriend
Messages: 2
Registered: October 2013
Junior Member
Hi, I am trying to create an ecore model in which an Eclass (class1) inherits from another one (class2) taken from another ecore model, but after adding the Inheritance association between them, the project does not compile anymore. Furthermore EReferencing the imported class and adding Inheritances among new EClasses works fine.
After building the main package, the .edit, and the .editor projects, I get the following errors:

-------------------------------------
Name clash: The method collectNewChildDescriptors(Collection<Object>, Object) of type class1ItemProvider has the same erasure as collectNewChildDescriptors(Collection, Object) of type class2ItemProvider but does not override it


CLASS2_OPERATION_COUNT cannot be resolved or is not a field


The method collectNewChildDescriptors(Collection<Object>, Object) of type class1ItemProvider must override or implement a supertype method

----------------------------------------


Does anyone know how to solve it?
Thanks


Marco

Re: Cannot add an Inheritance from a new EClass to an EClass imported from another ecore [message #1142337 is a reply to message #1141897] Thu, 17 October 2013 14:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Marco,

Comments below.

On 17/10/2013 4:50 PM, Marco Liberati wrote:
> Hi, I am trying to create an ecore model in which an Eclass (class1)
> inherits from another one (class2) taken from another ecore model, but
> after adding the Inheritance association between them, the project
> does not compile anymore.
After generating the code you mean...
> Furthermore EReferencing the imported class and adding Inheritances
> among new EClasses works fine.
> After building the main package, the .edit, and the .editor projects,
> I get the following errors:
>
> -------------------------------------
> Name clash: The method collectNewChildDescriptors(Collection<Object>,
> Object) of type class1ItemProvider has the same erasure as
> collectNewChildDescriptors(Collection, Object) of type
> class2ItemProvider but does not override it
So is the base model generating with Java 1.4 source compatibility?
I.e., without generics. If you extend such a model, you'll have
troubles if you try to use generics in places that it doesn't. It's
hard to imagine why people would still be generating with 1.4 source
compatibility. Is is the problem the other way around, that you aren't
generating for generics but the base one is. In any case, there
appears to be some inconsistency here
>
>
> CLASS2_OPERATION_COUNT cannot be resolved or is not a field
It sounds like you have Operation Reflection enabled in your derived
model but it's not enabled in the base model, so you'll have to disable
that.
>
>
> The method collectNewChildDescriptors(Collection<Object>, Object) of
> type class1ItemProvider must override or implement a supertype method
>
> ----------------------------------------
>
>
> Does anyone know how to solve it?
> Thanks
>
>
> Marco
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Cannot add an Inheritance from a new EClass to an EClass imported from another ecore [message #1143669 is a reply to message #1142337] Fri, 18 October 2013 10:43 Go to previous message
Marco Liberati is currently offline Marco LiberatiFriend
Messages: 2
Registered: October 2013
Junior Member
Hi Ed, you hit the nail on the head!

- The base model was generating in compatibility mode 1.4.
- Operation Reflection was not enabled in the base model.

After correcting these settings everything works fine.

Thank you.

Marco
Previous Topic: [CDO] Offline update of CDO objects
Next Topic:Need simple example bind EMF-Model value to simple swt widget
Goto Forum:
  


Current Time: Thu Apr 25 21:04:30 GMT 2024

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

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

Back to the top