Cannot add an Inheritance from a new EClass to an EClass imported from another ecore [message #1141897] |
Thu, 17 October 2013 09:02 |
Marco Liberati 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 |
Ed Merks Messages: 33142 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/
|
|
|
|
Powered by
FUDForum. Page generated in 0.02968 seconds