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.
[ BUILD # : 20051218 ] [ JDK VERSION : 1.4.2_xx ] The following exception was throwing while editing a XML file. There are no known steps to reproduce it: java.lang.IndexOutOfBoundsException: Index: 2, Size: 0 at java.util.ArrayList.add(ArrayList.java:371) at org.netbeans.modules.xml.text.navigator.TreeNodeAdapter.elementAdded(TreeNodeAdapter.java:305) at org.netbeans.modules.editor.structure.api.DocumentElement.fireDocumentElementEvent(DocumentElement.java:300) at org.netbeans.modules.editor.structure.api.DocumentElement.childAdded(DocumentElement.java:311) at org.netbeans.modules.editor.structure.api.DocumentModel$DocumentModelModificationTransaction.addDE(DocumentModel.java:988) at org.netbeans.modules.editor.structure.api.DocumentModel$DocumentModelModificationTransaction.commit(DocumentModel.java:915) at org.netbeans.modules.editor.structure.api.DocumentModel$DocumentModelModificationTransaction.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$2.run(DocumentModel.java:414) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:493) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:926)
*** Issue 70609 has been marked as a duplicate of this issue. ***
Almost impossible to fix without steps to reproduce :-(((
Well you can at least check the bounds before calling ArrayList.add, and if something is wrong, skip the operation, print whatever diagnostics you can to the log file, try to force a refresh of all cached data, etc.
I ment hard to fix to 5.0. I am already considering something like you mentioned to 5.1. Thanks
*** Issue 72352 has been marked as a duplicate of this issue. ***
increasing priority base on user report.
I have fixed the outgrowth of the problem - now the boundaries are checked and if the new element doesn't fit to the actual state of the node then a debug message is printed and the node is refreshed. Bad thing is that I am not able to reproduce so I am not 100% sure that the new code will not break something else, though I hope so. If you will see any inconsistences between the XML navigator and the xml document or any messages related to this please reopen or fill a new issue. Checking in TreeNodeAdapter.java; /cvs/xml/text-edit/src/org/netbeans/modules/xml/text/navigator/TreeNodeAdapter.java,v <-- TreeNodeAdapter.java new revision: 1.2.2.2.2.1; previous revision: 1.2.2.2 done
*** Issue 73152 has been marked as a duplicate of this issue. ***
v. no more occurences