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 84303 - Exception on switching to Schema view when schema is invalid
Summary: Exception on switching to Schema view when schema is invalid
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P1 blocker (vote)
Assignee: Ayub Khan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-06 14:36 UTC by kozlov
Modified: 2006-09-08 19:00 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 kozlov 2006-09-06 14:36:02 UTC
Reproduced in build 060904.

To reproduce the bug:

- create 'newSchema';
- switch to Source view;
- delete '>' in close tag '</xsd:schema>';
- switch to Schema view.

Exception:

java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
	at java.util.ArrayList.get(ArrayList.java:322)
	at java.util.Collections$UnmodifiableList.get(Collections.java:1154)
	at
org.netbeans.modules.xml.xdm.diff.DiffFinder.compareTokenEquals(DiffFinder.java:266)
	at
org.netbeans.modules.xml.xdm.diff.DiffFinder.compareTokenEquals(DiffFinder.java:237)
	at org.netbeans.modules.xml.xdm.diff.DiffFinder.checkChange(DiffFinder.java:227)
	at org.netbeans.modules.xml.xdm.diff.DiffFinder.checkChange(DiffFinder.java:218)
	at
org.netbeans.modules.xml.xdm.diff.DiffFinder.compareChildren(DiffFinder.java:146)
	at org.netbeans.modules.xml.xdm.diff.DiffFinder.findDiff(DiffFinder.java:74)
	at org.netbeans.modules.xml.xdm.diff.XDMTreeDiff.performDiff(XDMTreeDiff.java:50)
	at org.netbeans.modules.xml.xdm.diff.XDMTreeDiff.performDiff(XDMTreeDiff.java:59)
	at org.netbeans.modules.xml.xdm.XDMModel.prepareSync(XDMModel.java:141)
	at org.netbeans.modules.xml.xdm.XDMModel.sync(XDMModel.java:125)
	at org.netbeans.modules.xml.xdm.xam.XDMAccess.sync(XDMAccess.java:121)
	at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:226)
	at
org.netbeans.modules.xml.schema.core.SchemaEditorSupport.syncModel(SchemaEditorSupport.java:356)
	at
org.netbeans.modules.xml.schema.core.multiview.SchemaSourceMultiViewElement.componentHidden(SchemaSourceMultiViewElement.java:313)
	at org.netbeans.core.multiview.MultiViewPeer.hideElement(MultiViewPeer.java:229)
	at
org.netbeans.core.multiview.MultiViewPeer$SelectionListener.selectionChanged(MultiViewPeer.java:625)
	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:232)
	at javax.swing.ButtonGroup.setSelected(ButtonGroup.java:147)
	at
org.netbeans.core.multiview.MultiViewModel$BtnGroup.setSelected(MultiViewModel.java:276)
	at
org.netbeans.core.multiview.TabsComponent$ButtonMouseListener.mousePressed(TabsComponent.java:420)
	at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:222)
	at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:221)
	at java.awt.Component.processMouseEvent(Component.java:5996)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3240)
	at java.awt.Component.processEvent(Component.java:5764)
	at java.awt.Container.processEvent(Container.java:1984)
	at java.awt.Component.dispatchEventImpl(Component.java:4407)
	at java.awt.Container.dispatchEventImpl(Container.java:2042)
	at java.awt.Component.dispatchEvent(Component.java:4237)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4248)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3909)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3842)
	at java.awt.Container.dispatchEventImpl(Container.java:2028)
	at java.awt.Window.dispatchEventImpl(Window.java:2405)
	at java.awt.Component.dispatchEvent(Component.java:4237)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:600)
	at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Comment 1 Ayub Khan 2006-09-07 19:50:38 UTC
Looks like a XDM/XMLSyntaxParser.java issue.
Comment 2 Ayub Khan 2006-09-08 07:38:45 UTC
Fixed.

Files changed/added:

/cvs/xml/xdm/test/unit/src/org/netbeans/modules/xml/xdm/nodes/Attic/invalidtag2.xml
new revision: 1.1.2.1; previous revision: 1.1

/cvs/xml/xdm/test/unit/src/org/netbeans/modules/xml/xdm/nodes/XMLSyntaxParserTest.java
new revision: 1.1.2.5; previous revision: 1.1.2.4

/cvs/xml/xdm/src/org/netbeans/modules/xml/xdm/nodes/XMLSyntaxParser.java
new revision: 1.2.2.11; previous revision: 1.2.2.10
Comment 3 kozlov 2006-09-08 15:34:15 UTC
Verified in build060907.
Comment 4 Ayub Khan 2006-09-08 19:00:04 UTC
*** Issue 84525 has been marked as a duplicate of this issue. ***