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: | moving a class diagram and its classes don't move the associations between classes in generated .etd | ||
---|---|---|---|
Product: | uml | Reporter: | tichadok <tichadok> |
Component: | Project | Assignee: | Viktor Lapitski <lvv> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | blaha |
Priority: | P1 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | project for reproducing issue |
Description
tichadok
2007-11-29 16:33:13 UTC
In my opinion it's not an issue, because we may not fully comply with any project persistence specification and use our own model persistence realization. Did you see any information about uml module specifying format we are using? Here is a worse case : if you first create a "package1" with inside a class diagram with 2 classes and an association; then the associations are inside the package (in the generated .etd file). When you move the classes and the diagram anywhere else (in another "package2", or at the root of the projet) the association between classes don't move and stay in the initial "package1". Because you moved everything away from "package1" you can think it's empty. Because you think it's empty you can delete it, but then you loose all your links between classes : associations, compositions, navigable, aggregation ... and that is a big bug. Good catch. The second part is indeed a big bug. We'll investigate. Thanks, George The UML spec is not completely clear on who the owner of an association should be. Since an association is an ordered list of n ends, we think the owner of the association should be the same as the owner of the first end. fixed. Now association is created in the package-owner of first end classifier and it is moved with it as well. still persists in the NB 6.1 M1 build. I have 2 packages, a class diagram and 2 elements with association in package1, and I move them to package2. However the etd file still showing that the association is within package1. Please see attached project. -Joanne Created attachment 55467 [details]
project for reproducing issue
fixed. Fix verified in trunk 20080125143542 integrated into release61-m1 branch Tag: release61-m1 User: lvv Date: 2008/01/25 13:50:29 Modified: uml/core/src/org/netbeans/modules/uml/core/metamodel/infrastructure/coreinfrastructure/Classifier.java uml/core/src/org/netbeans/modules/uml/core/metamodel/core/foundation/Namespace.java uml/core/src/org/netbeans/modules/uml/core/metamodel/core/foundation/NamedElement.java Log: Fix for 123073 moving a class diagram and its classes don't move the associations between classes in generated .etd File Changes: Directory: /uml/core/src/org/netbeans/modules/uml/core/metamodel/infrastructure/coreinfrastructure/ =================================================================================================== File [changed]: Classifier.java Url: http://uml.netbeans.org/source/browse/uml/core/src/org/netbeans/modules/uml/core/metamodel/infrastructure/coreinfrastructure/Classifier.java?r1=1.8&r2=1.8.2.1 Delta lines: +2 -5 ------------------- --- Classifier.java 18 Jan 2008 03:29:15 -0000 1.8 +++ Classifier.java 25 Jan 2008 21:50:26 -0000 1.8.2.1 @@ -2908,11 +2908,8 @@ return retStereo; } - /** - * overrides NamedElement.setNamespace() - * to move Associations as well - */ - public void setNamespace(INamespace space) { + + public void moveAssociatedElements(INamespace space) { super.setNamespace(space); if (space == null) { return; Directory: /uml/core/src/org/netbeans/modules/uml/core/metamodel/core/foundation/ ================================================================================= File [changed]: Namespace.java Url: http://uml.netbeans.org/source/browse/uml/core/src/org/netbeans/modules/uml/core/metamodel/core/foundation/Namespace.java?r1=1.7&r2=1.7.6.1 Delta lines: +5 -0 ------------------- --- Namespace.java 15 Oct 2007 21:58:01 -0000 1.7 +++ Namespace.java 25 Jan 2008 21:50:27 -0000 1.7.6.1 @@ -137,6 +137,11 @@ } addElement(elem); helper.dispatchElementAddedToNamespace(this, elem); + + if (elem instanceof NamedElement) + { + ((NamedElement)elem).moveAssociatedElements(this); + } } retVal = true; File [changed]: NamedElement.java Url: http://uml.netbeans.org/source/browse/uml/core/src/org/netbeans/modules/uml/core/metamodel/core/foundation/NamedElement.java?r1=1.5&r2=1.5.8.1 Delta lines: +7 -0 ------------------- --- NamedElement.java 28 Sep 2007 08:51:08 -0000 1.5 +++ NamedElement.java 25 Jan 2008 21:50:27 -0000 1.5.8.1 @@ -571,6 +571,13 @@ space.addOwnedElement(this); } + /** + * if there some associated elements that should be + * moved as well. + */ + public void moveAssociatedElements(INamespace space) { + } + /** * * Adds this element to the supplier end of a Dependency relationship. --------------------------------------------------------------------- To unsubscribe, e-mail: cvs-unsubscribe@uml.netbeans.org For additional commands, e-mail: cvs-help@uml.netbeans.org Fix also verified in M1 build 200801280931 |