Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Redefinition code generation issue
Redefinition code generation issue [message #477648] Thu, 31 July 2008 00:39 Go to next message
Lutz Wrage is currently offline Lutz WrageFriend
Messages: 181
Registered: July 2009
Senior Member
I am wondering if the correct code is generated for a model like the
following.

I have classes A and B, A has property b of type B.
A' and B' are subclasses of A and B, respectively.
A' has a property b of type B', so this b redefines property b in A.

I would expect to see a method public B' getB() {...} in the code for A'
(which would be fine in Java 6, and compliance level is set to 6.0 in the
genmodel). However, the generated method returns an object of type B. Is
this a bug or did I miss something?

If I rename the property in A' to c, then I get: public B' getC() {...} (and
also public B getB() that returns the same value)

Thanks,
Lutz


  • Attachment: n.png
    (Size: 3.26KB, Downloaded 190 times)
Re: Redefinition code generation issue [message #477654 is a reply to message #477648] Thu, 31 July 2008 15:24 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Lutz,

Would it be possible to raise a bugzilla and attach a small sample model
with genmodel so that I can confirm all the various options are set.

Cheers,
- James.



"Lutz Wrage" <lwrage@sei.cmu.edu> wrote in message
news:g6r1ir$4c5$1@build.eclipse.org...
>I am wondering if the correct code is generated for a model like the
>following.
>
> I have classes A and B, A has property b of type B.
> A' and B' are subclasses of A and B, respectively.
> A' has a property b of type B', so this b redefines property b in A.
>
> I would expect to see a method public B' getB() {...} in the code for
> A' (which would be fine in Java 6, and compliance level is set to 6.0 in
> the genmodel). However, the generated method returns an object of type B.
> Is this a bug or did I miss something?
>
> If I rename the property in A' to c, then I get: public B' getC() {...}
> (and also public B getB() that returns the same value)
>
> Thanks,
> Lutz
>
>
Re: Redefinition code generation issue [message #626845 is a reply to message #477648] Thu, 31 July 2008 15:24 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Lutz,

Would it be possible to raise a bugzilla and attach a small sample model
with genmodel so that I can confirm all the various options are set.

Cheers,
- James.



"Lutz Wrage" <lwrage@sei.cmu.edu> wrote in message
news:g6r1ir$4c5$1@build.eclipse.org...
>I am wondering if the correct code is generated for a model like the
>following.
>
> I have classes A and B, A has property b of type B.
> A' and B' are subclasses of A and B, respectively.
> A' has a property b of type B', so this b redefines property b in A.
>
> I would expect to see a method public B' getB() {...} in the code for
> A' (which would be fine in Java 6, and compliance level is set to 6.0 in
> the genmodel). However, the generated method returns an object of type B.
> Is this a bug or did I miss something?
>
> If I rename the property in A' to c, then I get: public B' getC() {...}
> (and also public B getB() that returns the same value)
>
> Thanks,
> Lutz
>
>
Previous Topic:Saving an UML model
Next Topic:RSA/RSM comments are not saved properly
Goto Forum:
  


Current Time: Thu Apr 25 16:39:57 GMT 2024

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

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

Back to the top