This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 87424 - code generation adds unexpected members into source of transformed element
Summary: code generation adds unexpected members into source of transformed element
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Craig Conover
URL:
Keywords: REGRESSION
Depends on:
Blocks: 87423
  Show dependency tree
 
Reported: 2006-10-18 15:45 UTC by Andrew Korostelev
Modified: 2006-10-19 08:17 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Korostelev 2006-10-18 15:45:48 UTC
Code generation invoked for transformed element doesn't update element type in
java source file (filed as issue 87423)

But for some cases code generation adds unexpected members into source of
transformed element. This can make code uncompilable.
E.g. public constructor added to source of enumeration after it's transformation
to class.

steps to reproduce:
- create java-platform uml project
- create class diagram
- put enumeration on diagram and name it
- generate code.
- transform enum. element on diagram into class
- generate code.

BUG: public constructor is added to enum.
Comment 1 Craig Conover 2006-10-18 23:06:16 UTC
I think the reproduce steps are in reverse - should be:
- create Class, and add an operation
- Gen Code
- transform class to enum (constructor and ops are preserved)
- Gen Code, again
Comment 2 Craig Conover 2006-10-18 23:17:25 UTC
Now, it is valid for an enum to have ops, attrs and even constructors, but the
constructors must be declared private. This is not happening in the
transformation and I have opened a new issue for this: 87462

Ops and attrs are not deleted for the newly transformed Enumeration element even
though the dialog warns that it will be done. This is fine. See new issue for
details of what needs to happen.
Comment 3 Andrew Korostelev 2006-10-19 08:17:25 UTC
verified in all-nbms-griffin-061018_35.