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 79578 - NPE when invalid schema opens (2)
Summary: NPE when invalid schema opens (2)
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: bhate
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-03 11:59 UTC by Andrei Chistiakov
Modified: 2006-07-10 14:19 UTC (History)
4 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 Andrei Chistiakov 2006-07-03 11:59:32 UTC
Reproduced in build 060630_1.

To reproduce the bug open the following schema:

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://xml.netbeans.org/examples/targetNS"
            xmlns:tns="http://xml.netbeans.org/examples/targetNS"
            elementFormDefault="qualified">

    <xsd:element name="purchaseOrder" type="tns:PurchaseOrderType"/>
        <xsd:complexType>
            <xsd:sequence/>
        </xsd:complexType>
    
    <xsd:complexType name="PurchaseOrderType">
        <xsd:sequence>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

NPE throws with the following details:
java.lang.NullPointerException
	at
org.netbeans.modules.xml.schema.core.multiview.SchemaColumnViewMultiViewElement.getToolbarRepresentation(SchemaColumnViewMultiViewElement.java:362)
	at
org.netbeans.core.multiview.MultiViewPeer.showCurrentElement(MultiViewPeer.java:274)
	at
org.netbeans.core.multiview.MultiViewPeer.showCurrentElement(MultiViewPeer.java:235)
	at
org.netbeans.core.multiview.MultiViewPeer$SelectionListener.selectionChanged(MultiViewPeer.java:622)
	at
org.netbeans.core.multiview.MultiViewModel.fireSelectionChanged(MultiViewModel.java:230)
	at
org.netbeans.core.multiview.MultiViewModel.setActiveDescription(MultiViewModel.java:99)
	at
org.netbeans.core.multiview.MultiViewModel$BtnGroup.setSelected(MultiViewModel.java:280)
	at javax.swing.JToggleButton$ToggleButtonModel.setSelected(JToggleButton.java:215)
	at javax.swing.ButtonGroup.setSelected(ButtonGroup.java:139)
	at
org.netbeans.core.multiview.MultiViewModel$BtnGroup.setSelected(MultiViewModel.java:276)
	at javax.swing.JToggleButton$ToggleButtonModel.setSelected(JToggleButton.java:215)
	at javax.swing.AbstractButton.setSelected(AbstractButton.java:274)
	at
org.netbeans.core.multiview.TabsComponent.changeActiveManually(TabsComponent.java:153)
	at
org.netbeans.core.multiview.MultiViewPeer$MVTCHandler.requestActive(MultiViewPeer.java:648)
	at
org.netbeans.core.api.multiview.MultiViewHandler.requestActive(MultiViewHandler.java:73)
	at
org.netbeans.modules.xml.schema.core.multiview.SchemaMultiViewSupport.requestMultiviewActive(SchemaMultiViewSupport.java:193)
	at
org.netbeans.modules.xml.schema.core.multiview.SchemaMultiViewSupport.requestSchemaViewOpen(SchemaMultiViewSupport.java:99)
	at
org.netbeans.modules.xml.schema.core.SchemaDataObject$SchemaNode$1.actionPerformed(SchemaDataObject.java:103)
	at org.openide.explorer.view.TreeView$PopupSupport.mouseClicked(TreeView.java:1364)
	at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
	at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:211)
	at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:211)
	at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:211)
	at java.awt.Component.processMouseEvent(Component.java:5491)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
	at java.awt.Component.processEvent(Component.java:5253)
	at java.awt.Container.processEvent(Container.java:1966)
	at java.awt.Component.dispatchEventImpl(Component.java:3955)
	at java.awt.Container.dispatchEventImpl(Container.java:2024)
	at java.awt.Component.dispatchEvent(Component.java:3803)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3901)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
	at java.awt.Container.dispatchEventImpl(Container.java:2010)
	at java.awt.Window.dispatchEventImpl(Window.java:1774)
	at java.awt.Component.dispatchEvent(Component.java:3803)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Comment 1 bhate 2006-07-07 00:10:46 UTC
we wont initialize toolbar if model is invalid (not well formed)
Comment 2 Andrei Chistiakov 2006-07-10 14:19:40 UTC
Verified in build 060709.