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 73152 - IOOBE from TreeNodeAdapter
Summary: IOOBE from TreeNodeAdapter
Status: VERIFIED DUPLICATE of bug 70678
Alias: None
Product: xml
Classification: Unclassified
Component: Tree-Edit (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-01 17:37 UTC by _ tboudreau
Modified: 2007-09-25 06:06 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 _ tboudreau 2006-03-01 17:37:25 UTC
Opened the layer file for some module, wanting to move a menu item from the 
file menu to the Edit menu.  I changed "File" to edit in the folder 
definition, then went down one line and used Ctrl-E to delete the first 
ordering attribute.  Then pressed down arrow to skip the .shadow definition 
and moved down to the second ordering attribute.  I pressed Ctrl-E again, then 
decided I wanted it on the clipboard and pressed Ctrl-Z almost immediately to 
undelete that line.  Apparently this was while the tree was rebuilding its 
model, and it threw the exception below.

Two ways to avoid this I can think of:  1.  Run the scan under the Document's 
lock (but it could block editing), or 2., use getText() to take a snapshot of 
the document and parse that, not the live contents in the editor.

java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
	at java.util.ArrayList.add(ArrayList.java:367)
	at org.netbeans.modules.xml.text.navigator.TreeNodeAdapter.elementAdded
(TreeNodeAdapter.java:305)
	at 
org.netbeans.modules.editor.structure.api.DocumentElement.fireDocumentElementEv
ent(DocumentElement.java:300)
	at org.netbeans.modules.editor.structure.api.DocumentElement.childAdded
(DocumentElement.java:311)
	at 
org.netbeans.modules.editor.structure.api.DocumentModel$DocumentModelModificati
onTransaction.addDE(DocumentModel.java:988)
	at 
org.netbeans.modules.editor.structure.api.DocumentModel$DocumentModelModificati
onTransaction.commit(DocumentModel.java:915)
	at 
org.netbeans.modules.editor.structure.api.DocumentModel$DocumentModelModificati
onTransaction.access$100(DocumentModel.java:782)
	at org.netbeans.modules.editor.structure.api.DocumentModel.updateModel
(DocumentModel.java:440)
	at org.netbeans.modules.editor.structure.api.DocumentModel.access$400
(DocumentModel.java:97)
	at org.netbeans.modules.editor.structure.api.DocumentModel$1.run
(DocumentModel.java:414)
	at org.openide.util.RequestProcessor$Task.run
(RequestProcessor.java:514)
[catch] at org.openide.util.RequestProcessor$Processor.run
(RequestProcessor.java:947)
Comment 1 _ tboudreau 2006-03-01 17:50:56 UTC
Note also similar exception if I have the XML layer node of my module expanded 
and the layer file open in the editor, and I drag a menu item to a different 
location under Menu Bar/Edit.  Seems very reproducible.

java.lang.IndexOutOfBoundsException: Index: 19, Size: 2
        at java.util.ArrayList.add(ArrayList.java:367)
        at org.netbeans.modules.xml.text.navigator.TreeNodeAdapter.elementAdded
(
TreeNodeAdapter.java:305)
        at 
org.netbeans.modules.editor.structure.api.DocumentElement.fireDocumen
tElementEvent(DocumentElement.java:300)
        at org.netbeans.modules.editor.structure.api.DocumentElement.childAdded
(
DocumentElement.java:311)
Comment 2 Marek Fukala 2006-05-23 09:22:58 UTC

*** This issue has been marked as a duplicate of 70678 ***
Comment 3 _ hong_lin 2007-08-15 20:17:58 UTC
Close "DUPLICATE" issue
Comment 4 _ tboudreau 2007-08-15 21:02:41 UTC
An issue filed in 2006 has a target milestone of NetBeans 3.3 released in 2001?
Comment 5 Marek Fukala 2007-08-16 14:10:52 UTC
Hong Lin likely did some automatic issues update since this is not the only issue closed as duplicate with TM set to 3.3.