[Uml-devel] (fixed) bug in Java code generation
Olaf Hartig
OleBowle at gmx.de
Wed Jun 1 04:48:47 UTC 2005
Hello,
I've found and (probably) fixed the following bug in Umbrello 1.4.1 (released
with KDE 3.4.1).
I want to generate Java code without accessor methods. So I uncheck the two
checkboxes
- Attribute accessor methods
- Association accessor methods
at the "Language Options" tab in the "Code Generation Wizard" dialog. For
association accessors it works fine but not for attribute accessors - the
generated code always contains these accessor methods wether the
corresponding checkbox is checked or not. Umh?
After a short investigation I found the function CodeClassField::updateContent
in ./umbrello/codeclassfield.cpp and added the following else branch to the
main if clause:
if (!parentIsAttribute())
{
// ... snip ...
}
else
{
for ( CodeAccessorMethod * method = m_methodVector.first(); method;
method=m_methodVector.next() )
method->setWriteOutText( m_writeOutMethods );
}
... and voila - it works!
I'm not sure if this patch breaks code generation for other languages, since
it does not seem to be used for Java code generation explicitly.
If you consider this patch useful, please commit it to CVS.
--
Bye,
Ole
----------
GnuPG key: http://www.informatik.hu-berlin.de/~hartig/hartig.asc
----------
In a world without walls and fences,
who needs Windows and Gates?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/umbrello-devel/attachments/20050601/f8daf8c0/attachment.sig>
More information about the umbrello-devel
mailing list