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 92273 - Cut/Paste an element declaration wipes out the model group that the element declaration is being pasted to
Summary: Cut/Paste an element declaration wipes out the model group that the element d...
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Nathan Fiedler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-11 04:40 UTC by J Xu
Modified: 2007-02-05 22:57 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 J Xu 2007-01-11 04:40:06 UTC
Cut/Paste an element declaration wipes out the model group that the element
declaration is being pasted to.  To reproduce:

1. Create a global element declaration with local complex type definition with
local sequence group (call it S1 for convenience)
2. Add a local element declaration with local complex type declaration with
local sequence group (call it S2) the sequence group S1
3. Add a local element declaration (call it E1) with built-in type xsd:string to
sequence group S2
4. Cut E1 and paste it to S1.

Please note that sequence group S1 is gone.  The complex type definition that
encloses S1 is still there but is empty.
Comment 1 Nathan Fiedler 2007-01-11 23:14:08 UTC
It looks like when copy/cut is performed on the E1 node, the code is in fact
acting on the S2 sequence, which is incorrect.
Comment 2 Nathan Fiedler 2007-02-01 01:30:02 UTC
The SchemaComponentNode lookup had the context's lookup first, which resulted in
the currently selected node, whatever that may be, to show up first. So anytime
getCookie() was called for something like GetComponentCookie, it was actually
getting the selected node, not the node that getCookie() was called on. I am
guessing this was a mistake (probably on my part), so I have put the node's own
lookup contents ahead of those from the context lookup, which is probably as it
should have been from the beginning. Made the same change for WSDL, just to be safe.

Fixed in release551 branch.

schema/schemaui/src/org/netbeans/modules/xml/schema/ui/nodes/SchemaComponentNode.java;
new revision: 1.1.2.72.4.4; previous revision: 1.1.2.72.4.3
wsdlui/src/org/netbeans/modules/xml/wsdl/ui/view/treeeditor/WSDLElementNode.java;
new revision: 1.1.2.26.4.5; previous revision: 1.1.2.26.4.4
Comment 3 htt 2007-02-05 22:57:47 UTC
Verified in 070205_12.