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 96482 - Delete newly added attribute throws exception in Design View
Summary: Delete newly added attribute throws exception in Design View
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: Ayub Khan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-23 22:02 UTC by tonybeckham
Modified: 2007-03-07 23:43 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 tonybeckham 2007-02-23 22:02:33 UTC
If you add a new attribute to an Element or COmplex type in design view, then
delete that attribute, an illegal argument exception is thrown.

System Info:
Ubuntu 6.10 x86
NB + Gavotte Beta: java-tools-bundle-u3-preview-gavotte_beta-070220_4-linux.sh

Steps:
I used HL7 schema but any should work.
1. open shema go to design view
2. Drag a new attribute onto an element or COmplex Tyoe that has existing
attributes (such as element AAC.5 in HL7)
3. Accept default name for new attribute.
4. Delete attribute you just added, this exception is thrown:

java.lang.IllegalArgumentException: Exception during flush: 
	at org.netbeans.modules.xml.axi.impl.ModelAccessImpl.flush(ModelAccessImpl.java:92)
	at
org.netbeans.modules.xml.xam.AbstractModel.endTransaction(AbstractModel.java:296)
	at
org.netbeans.modules.xml.xam.AbstractModel.endTransaction(AbstractModel.java:284)
	at
org.netbeans.modules.xml.schema.abe.nodes.ABEAbstractNode.doDelete(ABEAbstractNode.java:325)
	at
org.netbeans.modules.xml.schema.abe.nodes.ABEAbstractNode.remove(ABEAbstractNode.java:310)
	at
org.netbeans.modules.xml.schema.abe.nodes.ABEAbstractNode.destroy(ABEAbstractNode.java:343)
	at
org.openide.explorer.ExplorerActionsImpl$DeleteActionPerformer.doDestroy(ExplorerActionsImpl.java:620)
	at
org.openide.explorer.ExplorerActionsImpl$DeleteActionPerformer.performAction(ExplorerActionsImpl.java:570)
	at
org.openide.explorer.ExplorerActionsImpl$DeleteActionPerformer.actionPerformed(ExplorerActionsImpl.java:631)
	at
org.openide.util.actions.CallbackSystemAction$DelegateAction$1.run(CallbackSystemAction.java:559)
	at
org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.actionPerformed(ActionsBridge.java:87)
	at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:80)
	at
org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:30)
	at
org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.doRun(ActionsBridge.java:78)
	at org.netbeans.modules.openide.util.ActionsBridge$1.run(ActionsBridge.java:47)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
Caused by: java.lang.IllegalArgumentException: component to be deleted is not a
child
	at
org.netbeans.modules.xml.xam.AbstractComponent.removeChild(AbstractComponent.java:337)
	at
org.netbeans.modules.xml.schema.model.impl.CommonComplexTypeImpl.removeLocalAttribute(CommonComplexTypeImpl.java:73)
	at
org.netbeans.modules.xml.axi.impl.SchemaGeneratorUtil.removeLocalAttribute(SchemaGeneratorUtil.java:930)
	at
org.netbeans.modules.xml.axi.impl.SchemaGeneratorUtil.removeSchemaComponent(SchemaGeneratorUtil.java:847)
	at
org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator$UpdateHelper.execute(DefaultSchemaGenerator.java:734)
	at
org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.updateSchema(DefaultSchemaGenerator.java:108)
	at
org.netbeans.modules.xml.axi.impl.SchemaGeneratorFactoryImpl.updateSchema(SchemaGeneratorFactoryImpl.java:70)
	at org.netbeans.modules.xml.axi.impl.ModelAccessImpl.flush(ModelAccessImpl.java:90)
	... 16 more
Comment 1 Ayub Khan 2007-02-28 09:19:31 UTC
Fixed in 551

Files changed:

/cvs/xml/axi/src/org/netbeans/modules/xml/axi/impl/SchemaGeneratorUtil.java
new revision: 1.1.2.28.6.6; previous revision: 1.1.2.28.6.5

/cvs/xml/axi/src/org/netbeans/modules/xml/axi/impl/DefaultSchemaGenerator.java
new revision: 1.1.2.67.6.6; previous revision: 1.1.2.67.6.5

/cvs/xml/axi/test/unit/src/org/netbeans/modules/xml/axi/SchemaGeneratorTest.java
new revision: 1.1.2.10.6.3; previous revision: 1.1.2.10.6.2
Comment 2 tonybeckham 2007-03-07 23:43:48 UTC
Fixed Verified Build: 070307_11