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 91577 - REGRESSION: Apply Design Pattern - Discard changes - Apply again causes exception
Summary: REGRESSION: Apply Design Pattern - Discard changes - Apply again causes excep...
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-26 17:10 UTC by Mikhail Matveev
Modified: 2007-02-08 22:13 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 Mikhail Matveev 2006-12-26 17:10:59 UTC
1. Create new sample schema - newLoanApplication.
2. Right-click on newLoanApplication.xsd in Projects window, choose Apply Design
Pattern.
3. Specify suitable parameters (in this case, select Create Multiply Global
Elements) and press Finish.
4. Close newLoanApplication.xsd window and choose Discard changes.
5. Repeat 2 and 3.
Result: exception comes. Many different exceptions can come - I got
NullPointerException, IllegalArgumentException, AssertionErrorException,
ArrayIndexOutOfBoundException
Comment 1 Ayub Khan 2007-01-16 20:43:21 UTC
Assertion Error:

java.lang.AssertionError
        at org.netbeans.modules.xml.axi.impl.AXIModelImpl.lookupFromOtherModel(A
XIModelImpl.java:112)
        at org.netbeans.modules.xml.axi.impl.AXIModelBuilder.getAXIComponent(AXI
ModelBuilder.java:283)
        at org.netbeans.modules.xml.axi.impl.AXIModelBuilder.visit(AXIModelBuild
er.java:211)
        at org.netbeans.modules.xml.schema.model.impl.GlobalComplexTypeImpl.acce
pt(GlobalComplexTypeImpl.java:114)
        at org.netbeans.modules.xml.axi.impl.AXIModelBuilder.populateChildren(AX
IModelBuilder.java:65)
        at org.netbeans.modules.xml.axi.impl.ElementImpl.populateChildren(Elemen
tImpl.java:272)
        at org.netbeans.modules.xml.xam.AbstractComponent._getChildren(AbstractC
omponent.java:130)
        at org.netbeans.modules.xml.xam.AbstractComponent.getChildren(AbstractCo
mponent.java:114)
        at org.netbeans.modules.xml.axi.impl.AXIModelUpdater.childExists(AXIMode
lUpdater.java:211)
        at org.netbeans.modules.xml.axi.impl.AXIModelUpdater.removeRemovedChildr
en(AXIModelUpdater.java:164)
        at org.netbeans.modules.xml.axi.impl.AXIModelUpdater.synchronize(AXIMode
lUpdater.java:149)
        at org.netbeans.modules.xml.axi.impl.AXIModelUpdater.visitChildren(AXIMo
delUpdater.java:115)
        at org.netbeans.modules.xml.axi.impl.AXIModelUpdater.visit(AXIModelUpdat
er.java:289)
        at org.netbeans.modules.xml.axi.impl.AXIModelUpdater.visit(AXIModelUpdat
er.java:261)
        at org.netbeans.modules.xml.axi.Element.accept(Element.java:59)
        at org.netbeans.modules.xml.axi.impl.AXIModelUpdater.doSync(AXIModelUpda
ter.java:81)
        at org.netbeans.modules.xml.axi.impl.AXIModelImpl.doSync(AXIModelImpl.ja
va:196)
        at org.netbeans.modules.xml.axi.impl.ModelAccessImpl.sync(ModelAccessImp
l.java:79)
        at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:23
0)
        at org.netbeans.modules.xml.axi.impl.AXIModelImpl.sync(AXIModelImpl.java
:182)
        at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator$TransformHel
per.execute(DefaultSchemaGenerator.java:844)
        at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformSch
ema(DefaultSchemaGenerator.java:114)
        at org.netbeans.modules.xml.axi.impl.SchemaGeneratorFactoryImpl.transfor
mSchema(SchemaGeneratorFactoryImpl.java:206)
        at org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformWizard$1.ru
n(SchemaTransformWizard.java:146)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)

[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:932)
Comment 2 Ayub Khan 2007-01-16 21:03:41 UTC
If I open the file and apply design pattern, then I do not see exception.

ie., with the modified script below

1. Create new sample schema - newLoanApplication.
2. Right-click on newLoanApplication.xsd in Projects window, choose Apply Design
Pattern.
3. Specify suitable parameters (in this case, select Create Multiply Global
Elements) and press Finish.
4. Close newLoanApplication.xsd window and choose Discard changes.
5. open newLoanApplication.xsd 
5. Repeat 2 and 3.
Comment 3 Ayub Khan 2007-02-06 04:45:49 UTC
Fixed in release551 branch.

Files changed:
/cvs/xml/schema/core/src/org/netbeans/modules/xml/schema/core/actions/SchemaTransformAction.java
new revision: 1.1.2.11.6.2; previous revision: 1.1.2.11.6.1
Comment 4 htt 2007-02-08 22:13:43 UTC
Verified that the aforementioned exceptions no longer occur in 070208_8;
however, a different issue is found as a side effect of this same scenario (see
issue 95013).