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 78594 - [55cat] It's possible to add two attributes with the same name by DnD
Summary: [55cat] It's possible to add two attributes with the same name by DnD
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Craig Conover
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-20 13:32 UTC by bugbridge
Modified: 2007-09-19 20:48 UTC (History)
2 users (show)

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 bugbridge 2006-06-20 13:32:26 UTC
steps to reproduce:
1. create 'a' and 'b' classes
2. add attribute 'd' to 'a'
3' drag 'd' with CTRL from 'a' to 'b'
4' drag 'd' with CTRL from 'a' to 'b'
there are two attributes with name 'd' in class 'b'
Comment 1 Peter Lam 2007-02-27 23:55:23 UTC
from user survey
Comment 2 Peter Lam 2007-02-28 19:16:49 UTC
This is a very minor issue that is user avoidable. Can be waived for this release.
Comment 3 Craig Conover 2007-03-01 00:40:55 UTC
You can also do the same with operations. Intent is to implement a polymorphic
method, isSimlar, is check if the element being DnD'ed is "similar" to any
existing. For attributes, just need to check the name, but operation, must check
the name of the operation (same as attr's) and check the number and type of the
parameters. And Classifiers need to check name and package, and so on.

If a "similar" element is found, then it would be standard behavior to popup a
dialog notifying the user why the DnD failed, but this requires UI and L10N
changes. Need QE to provide guidance here.

Solution has been implemented, and now in testing phase.
Comment 4 Craig Conover 2007-03-01 01:39:34 UTC
Solution works with attr's and ops. A silent failure will have to do for this
release, which is better than it succeeding when it should not. Next release,
sort of informational dialog or opportunity to change the name of the dropped
element will be implemented. Waiting for QA approval to integrate.
Comment 5 Craig Conover 2007-03-02 22:26:46 UTC
It was decided not to integrate this fix into UML on NB 5.5 release because we
are past code freeze and this is not a showstopper or regression. There is no
serious side effect and the proper fix would be to alert with a dialog and allow
to change the name, but UI changes require L10N and docs updates and we are past
that deadline.

This fix will be itegrated into the UML on NB 6.0 release with the proper dialog
prompting.
Comment 6 Craig Conover 2007-03-09 01:50:01 UTC
The functionality is in place, and the dialog UI is complete. Only thing left is
to validate the "new name" entry and A11Y.
Comment 7 Craig Conover 2007-04-25 02:58:29 UTC
Proper valid name checking and error reporting and A11Y in place.
Comment 8 Alexandr Scherbatiy 2007-06-07 12:14:43 UTC
Drag the attribute with CTRL from one class to another which has the same
attribute. The 'Duplicate Element Found' dialog pops up.
Nevertheless the 'OK' button is enabled on the dialog. Press 'OK' button.
The second attribute is added. So the class contains two attributes with the
same name.
Comment 9 Craig Conover 2007-07-13 21:13:53 UTC
OK button was not being disabled when the dialog was first displayed.
Comment 10 Joanne Lau 2007-09-19 20:48:42 UTC
"Duplicate Element Found" dialog now appears. Verified in trunk instrumented build 200709180324.