That was so misleading... Here the clarification:
The stack overflow occurs if the feature is accessed using eGet and
eIsSet, which are used in the generated editor, for example. That's
where I ran into the problem.
The generated isSet and getB methods are obviously fine, and there
certainly is code to handle multiple inheritance. It seems that it's not
enough, though.
- Lutz
Lutz Wrage wrote, on 7/16/2008 9:41 AM:
Hi,
I ran into the following problem when generating code from my
metamodel. It's when I use a combination of multiple inheritance an
redefinition. See the attached file for a minimal example.
I have a class C that specializes two classes A and B. A and B have
properties a and b, respectively. In C I redefine both properties. I
generate code for this model (with processing duplicate features). The
generated Java implementation class CImpl extends AImpl.
However, the generated code has the problem that it is impossible to
get the value of feature b in C, because eGet, etc., only go up the
Java inheritance hierarchy. Accessing C.b in any way leads to a stack
overflow. To me this looks like an oversight in the UML code generator
because it creates no code that takes UML multiple inheritance into
account for this scenario.
I changed my metamodel to use subsetting instead, but that's not quite
the correct semantics in my situation.
- Lutz