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.
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)
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)
*** This issue has been marked as a duplicate of 70678 ***
Close "DUPLICATE" issue
An issue filed in 2006 has a target milestone of NetBeans 3.3 released in 2001?
Hong Lin likely did some automatic issues update since this is not the only issue closed as duplicate with TM set to 3.3.