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.
Summary: | Links with multiplicity ends are not drawn for attributes that have Collection type | ||
---|---|---|---|
Product: | uml | Reporter: | Alexandr Scherbatiy <sunflower> |
Component: | Reverse Engineering | Assignee: | Trey Spiva <tspiva> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | tspiva |
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
Aggregation link is not drawn on Class diagram
Class diagram of generic collections. |
Description
Alexandr Scherbatiy
2007-02-07 15:05:53 UTC
Created attachment 38177 [details]
Aggregation link is not drawn on Class diagram
Take a look at the image. You will notice that the aggregation association is not between classes B and A. It is between B and the derivation classifier LinkedList < A >. If you a CDFS between B and the derivation classifier you will see the association. The LinkedList class is not only a Generic class. It is also is a class from Collection framework. For example create A and B class on the Class diagram, draw a Navigable Aggregation link from B to A, set multiplicity ends to '*' near 'A' end and generate a code. The result will contain the collection type: ----------------------------------------- public class B { private ArrayList<A> mA; } ----------------------------------------- So the Reverse Engineering should also create links with multiplicity ends for collection types. Or you could also reverse engineer and create a class diagram for the following java classes: ----------------------------------------- public class A { } public class B { A [] a; } ----------------------------------------- LinkedList is a generic class, because you are passing a parameter into decloration of the object. I understand that you want to have reverse engineering create an association with multiplicity. That is a good idea. I think we already have an issue with this request. But this is how the code is currently designed. So, I am going to make this an enhancement. Created attachment 39352 [details]
Class diagram of generic collections.
We are now converting collections to multiplicies. The following use cases where tested. public class A { private ArrayList < B > b = new ArrayList < B >(); private ArrayList < ArrayList < B > > bb = new ArrayList < ArrayList < B > >(); private ArrayList < MyGenric < B >> m = null; private ArrayList < ArrayList <MyGenric < B > >> mm = null; /** Creates a new instance of A */ public A() { } public void myOp(ArrayList < B > b) { } public void myOp(ArrayList < ArrayList < B > > b) { } public void myOp(ArrayList < MyGenric < B > > b) { } public void myOp(ArrayList < ArrayList < MyGenric < B > > > b) { } public ArrayList < ArrayList < MyGenric < B > > > myOp() { } } public class B { } public class MyGeneric < T> { } See the resulting generic_collections.png image that is attached to this issue. forgot to assing the issue to my self fixed, and assigned This has been moved to NetBeans 5.5 code line as well. Verified. The situation for attributes like 'List<String> list;' is described in issue 97838 Collections that have members from library are not shown as association link with multiplicity after RE |