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 82089

Summary: NPE on applying design pattern 2nd time
Product: xml Reporter: Andrei Chistiakov <ca-nb>
Component: Schema ToolsAssignee: Ayub Khan <ayubskhan>
Status: VERIFIED FIXED    
Severity: blocker CC: cwebster, htt, ivansidorkin, kozlov
Priority: P1    
Version: 5.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: Sam, please see the attachment, that highlights the navigator. After the second transform the model shows only one element 'purchaseOrder', so I think the transform went OK. The NPE is occuring after transform where I do a force sync.

Description Andrei Chistiakov 2006-08-07 16:07:00 UTC
Reproduced in build 060807_2.

To reproduce the bug:
- open a project that includes PO schema (do not open the schema itself);
- apply Russian Doll pattern to the schema;
- open the schema;
- close the schema, discard changes;
- apply Russian Doll pattern to the schema second time.

java.lang.NullPointerException
	at
org.netbeans.modules.xml.xam.AbstractComponent.verifyWrite(AbstractComponent.java:188)
	at
org.netbeans.modules.xml.xam.AbstractComponent.insertAtIndex(AbstractComponent.java:321)
	at
org.netbeans.modules.xml.xam.AbstractComponent.insertAtIndex(AbstractComponent.java:339)
	at org.netbeans.modules.xml.axi.AXIComponent.insertAtIndex(AXIComponent.java:438)
	at org.netbeans.modules.xml.axi.AXIComponent.addChildAtIndex(AXIComponent.java:430)
	at org.netbeans.modules.xml.axi.AXIComponent.addChildAtIndex(AXIComponent.java:423)
	at
org.netbeans.modules.xml.axi.impl.AXIModelUpdater.addNewChildren(AXIModelUpdater.java:172)
	at
org.netbeans.modules.xml.axi.impl.AXIModelUpdater.synchronize(AXIModelUpdater.java:133)
	at
org.netbeans.modules.xml.axi.impl.AXIModelUpdater.visitChildren(AXIModelUpdater.java:110)
	at
org.netbeans.modules.xml.axi.impl.AXIModelUpdater.visit(AXIModelUpdater.java:278)
	at org.netbeans.modules.xml.axi.Compositor.accept(Compositor.java:93)
	at
org.netbeans.modules.xml.axi.impl.AXIModelUpdater.visitChildren(AXIModelUpdater.java:118)
	at
org.netbeans.modules.xml.axi.impl.AXIModelUpdater.visit(AXIModelUpdater.java:226)
	at
org.netbeans.modules.xml.axi.impl.AXIModelUpdater.visit(AXIModelUpdater.java:210)
	at org.netbeans.modules.xml.axi.Element.accept(Element.java:58)
	at
org.netbeans.modules.xml.axi.impl.AXIModelUpdater.doSync(AXIModelUpdater.java:89)
	at org.netbeans.modules.xml.axi.impl.AXIModelImpl.doSync(AXIModelImpl.java:144)
	at org.netbeans.modules.xml.axi.impl.ModelAccessImpl.sync(ModelAccessImpl.java:92)
	at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:221)
	at
org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformSchema(DefaultSchemaGenerator.java:151)
	at
org.netbeans.modules.xml.axi.impl.SchemaGeneratorFactoryImpl.transformSchema(SchemaGeneratorFactoryImpl.java:105)
	at
org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformWizard$1.run(SchemaTransformWizard.java:115)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
Comment 1 Ayub Khan 2006-08-08 19:11:21 UTC
Created attachment 32662 [details]
Sam, please see the attachment, that highlights the navigator. After the second transform the model shows only one element 'purchaseOrder', so I think the transform went OK. The NPE is occuring after transform where I do a force sync.
Comment 2 Ayub Khan 2006-08-08 19:12:16 UTC
Sam, please see the attachment, that highlights the navigator. After the second
transform the model shows only one element 'purchaseOrder', so I think the
transform went OK. The NPE is occuring after transform where I do a force sync.
Can you take a look at it. This is reproduced even in 'release55' branch.
Comment 3 Samaresh Panda 2006-08-08 20:00:18 UTC
When the user discards the changes, model is not updated. That is model is not
in sync with the discarded changes and hence when second time when some other
pattern  is applied, it acts wild.
Comment 4 Samaresh Panda 2006-08-09 16:43:31 UTC
Looks like the transformation resets the peer for the AXIComponents. As per our
discussion, Ayub will need to revisit the way the peers are being set.
Comment 5 Ayub Khan 2006-08-09 23:24:18 UTC
Fix for Coke Beta

Checking in src/org/netbeans/modules/xml/axi/impl/DefaultSchemaGenerator.java;
new revision: 1.1.2.22.2.2; previous revision: 1.1.2.22.2.1

Checking in src/org/netbeans/modules/xml/axi/impl/VenetianBlind.java;
new revision: 1.1.2.11.2.2; previous revision: 1.1.2.11.2.1

Checking in src/org/netbeans/modules/xml/axi/impl/GardenOfEden.java;
new revision: 1.1.2.15.2.2; previous revision: 1.1.2.15.2.1

Checking in src/org/netbeans/modules/xml/axi/impl/SalamiSlice.java;
new revision: 1.1.2.9.2.2; previous revision: 1.1.2.9.2.1

Checking in src/org/netbeans/modules/xml/axi/impl/Util.java;
new revision: 1.1.2.45.2.2; previous revision: 1.1.2.45.2.1

Checking in test/unit/src/org/netbeans/modules/xml/axi/resources/courier.xsd;
new revision: 1.1.4.1; previous revision: 1.1

Checking in test/unit/src/org/netbeans/modules/xml/axi/SchemaTransformTest.java;
new revision: 1.1.2.18.2.2; previous revision: 1.1.2.18.2.1
Comment 6 Andrei Chistiakov 2006-08-11 13:15:48 UTC
Verified in build 060810_1.