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 87373 - Generate Code does not work for Nested Elements
Summary: Generate Code does not work for Nested Elements
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Craig Conover
URL:
Keywords:
: 82248 (view as bug list)
Depends on:
Blocks: 78455
  Show dependency tree
 
Reported: 2006-10-18 03:27 UTC by Craig Conover
Modified: 2006-10-19 11:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Diagram of my inner elements testing (56.60 KB, image/png)
2006-10-19 05:01 UTC, Craig Conover
Details
Generated Code for the Outer element of the attached diagram (765 bytes, text/plain)
2006-10-19 05:02 UTC, Craig Conover
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Conover 2006-10-18 03:27:18 UTC
For nested elements that were not RE'ed from Java sources (they were created in
a Java Platform Model), no code is generated during Generate Code action. The
outer class is generated, but inner (nested) classes and enumerations are ignored.

- Create Java Platform Model Project
- Create Class Diagram
- Create a Class and name it Host
- Create an Class or Enumeration, name it Nest
- Draw a Nested link from Nest element to Host element
- Generate Code for Host element
[code is generated for Host but no sign of Nest inside of it]
- Generate Code specifically for Nest element
[no code is generated inside of Host source file]
Comment 1 Craig Conover 2006-10-19 02:25:53 UTC
*** Issue 82248 has been marked as a duplicate of this issue. ***
Comment 2 Craig Conover 2006-10-19 04:59:34 UTC
Inner Interfaces were not being generated either, but they are basically same as
Classes. 

This is now working for multi-level nested elements (class inside an inner
class). See attachments for example of innner elements I tested and its
generated source code. I'm sure there are some even more goofy edge cases that I
haven't tested.

If you Generate Code by invoking it on the outermost class element, everything
is generated just fine. But if Generate Code is invoked directly on an inner
class element, then nothing is generated. This is an issue of a different kind
and I have opened a new issue for it: 87474

Just to make sure no regressions for Enumeration code gen, I tested generating
code for an Enumeration element that is not an inner element because I had to
modify the "add literal" and "add enum" logic a little.
Comment 3 Craig Conover 2006-10-19 05:01:32 UTC
Created attachment 35362 [details]
Diagram of my inner elements testing
Comment 4 Craig Conover 2006-10-19 05:02:48 UTC
Created attachment 35363 [details]
Generated Code for the Outer element of the attached diagram
Comment 5 Andrew Korostelev 2006-10-19 11:35:33 UTC
verified in all-nbms-griffin-061018_35