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.
This problem appeared after fixing issue 109123 (change in openide/explorer/src/org/openide/explorer/view/ListView.java http://deadlock.netbeans.org/fisheye/browse/netbeans/openide/explorer/src/org/openide/explorer/view/ListView.java?r1=1.12&r2=1.13). ArrayIndexOutOfBoundsException is thrown when you switch between Schema, Design, Source views in multiview editor for XML schema. It happens only on JDK1.6.0 and only if HierarchyEvent listener is added to Toolkit. We use such listeners in our testing tools, that's why this issue blocks automating testing. To reproduce: - run IDE with JDK1.6 - open attached module in IDE - call 'Install/Reload in Development IDE' action on module's project node - call 'Help|Add Listener' main menu action - open new file wizard - choose 'XML|XML Schema' and finish the wizard - switch to Design view in editor - switch to Schema view, again to Design and bunch of AIOOBEs will appear. If you call 'Help|Remove Listener', it works without exceptions. Since build 200707241200, JDK1.6.0_02-b05.
Created attachment 46456 [details] Stack trace.
Created attachment 46457 [details] Module to simulate problem.
It is not clear to me how the change is related. Passing to Milos who maintain multiview.
It's true that my change looks unrelated, but it triggers the exception somehow. If my fix for 109123 is deleted, then exception is gone. I think it's JDK issue, but we have to prove it somehow...
I make up some solution, but it's not pretty as I can't find real reason of the exception, it's complete mystery to me, I'm giving up - maybe somebody smarter then me....
Created attachment 46584 [details] diff of hacky solution - model cleaning postponed by invokeLater
OK, fixed in main trunk: Checking in ListView.java; /cvs/openide/explorer/src/org/openide/explorer/view/ListView.java,v <-- ListView.java new revision: 1.14; previous revision: 1.13 done i wonder what other nice bugs will this fix trigger :-)
I spent half day on this without any result. Just curious why explorer.setRootContext(Node.EMPTY); called from DocumentsDlg on dialog close does not release references to documents? I want to say there should be another solution for #109123 than to call model.setNode(Node.EMPTY) for every ListView in removeNotify. (It might be even better as I can imagine use case that ListView can be reused so it is waste to always reset model....) I tested in JDK 7 b16 and it happens too. Current test app to reproduce this problem - patched IDE + separate module - is too big for investigation. Still we could try to file issue against AWT. I found problem happens only for org.netbeans.modules.xml.schema.multiview.SchemaColumnViewMultiViewElement always when component array has size 1 it is accessed with index 1. But it is not clear why as loop is not trivial.
Verified. Thank you.