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.
Happened to me twice in 060427, after trying to close an output tab w/ C-F4 while other tabs were open. After it happens, have to shut down IDE to stop the exceptions from being thrown repeatedly, hence P2 rating.
Created attachment 30257 [details] (initial) stack trace
Using Mustang b82 in case that is the cause.
*** Issue 76007 has been marked as a duplicate of this issue. ***
JDK issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6420152
Taking this one...
OK, so complete reproduction steps first: 1) Select Window/Output to show Output window 2) Open some java project backed in CVS, open some file and compile it 3) Perform some CVS operation (update) to have two inner Output tabs open. 4) Select the last one and try to close it (keyboard or mouse; doesn't matter) -> mentioned exception occurs.
The issue seems to be really on JDK side, it looks like selection model isn't synced well with tabs model. However it's possible to workaround it, I'll attach possible patch.
Created attachment 30323 [details] Possible workaround (prints debug info)
Some thoughts/hints for JDK side: The problem seems to be, that our JTabbedPane subclass is asking for JTabbedPane.getSelectedComponent() in its custom focus traversal policy. However the code in custom traversal policy is triggered from removeNotify() called on the tab being removed. Somehow, in this state, call to JTabbedPane.getSelectedComponent() leads to the disaster. getSelectedIndex will return invalid index (greater then size of the pages field (tabs vector)) and AIOOBE is thrown.
+ if (selIndex != -1 && selIndex >= tabC) { + // JDK bug 6420152 - selection model and tab model not in sync + System.out.println("NOT in SYNC!!!"); + return this; + } probably return the component at tabC-1 if > 0 rather than this. That way focus will still go to the last remaining tab, which presumably is what has become the selected one.
*** Issue 72737 has been marked as a duplicate of this issue. ***
That would be a great fix, since I'm bumping into this on a hourly basis, and have to restart the whole IDE under a corrupted UI every time it happens.
*** Issue 75725 has been marked as a duplicate of this issue. ***
*** Issue 76737 has been marked as a duplicate of this issue. ***
*** Issue 77620 has been marked as a duplicate of this issue. ***
What relevance, if any, is thre in the reference to JDK 6368047 in the discussion of JDK 6420152?
*** Issue 76896 has been marked as a duplicate of this issue. ***
Can we at least have a workaround in the trunk and probably release55? The bug still occurs using b87, so it would affect people downloading the Mustang beta. Very visible and annoying.
Yes, I'll commit workaround tomorrow to the trunk. As for release55, I'm leaving the decision to managers. Tondo and Jane, please decide. I attached small test program for easy reproduction to the jdk bug 6420152, so I hope JDK guys will be able to fix quickly now.
Too bad this wasn't nailed before Sun released Mustang beta 2 :(
Dafe, please, proceed with integrating the workaround into 5.5.
workarounded in main trunk: Checking in CloseButtonTabbedPane.java; /cvs/core/output2/src/org/netbeans/core/output2/ui/CloseButtonTabbedPane.java,v <-- CloseButtonTabbedPane.java new revision: 1.10; previous revision: 1.9
Created attachment 31322 [details] improved patch
workaround also in release55 branch: Checking in CloseButtonTabbedPane.java; /cvs/core/output2/src/org/netbeans/core/output2/ui/CloseButtonTabbedPane.java,v <-- CloseButtonTabbedPane.java new revision: 1.8.68.1; previous revision: 1.8
*** Issue 79163 has been marked as a duplicate of this issue. ***
*** Issue 79049 has been marked as a duplicate of this issue. ***
*** Issue 79804 has been marked as a duplicate of this issue. ***
*** Issue 80012 has been marked as a duplicate of this issue. ***
I believe this issue is back, though the stack-trace looks a bit difference. I got this stack-trace in dev build 200607201800.
Created attachment 32113 [details] JTabbedPane.getTitleAt() stack-trace
Forgot to mention, I got this under Mustang b92.
*** Issue 80760 has been marked as a duplicate of this issue. ***
JDK guys now confirmed that the fix on their side is ready and will come probably in mustang 94 version. So closing, nothing more I can do, just advice you to upgrade to mustang 94 when it's available.
*** Issue 81550 has been marked as a duplicate of this issue. ***
I tried NB dev (200608061800) with JDK 6.0 (b94) and it works fine.
*** Issue 74500 has been marked as a duplicate of this issue. ***
*** Issue 82952 has been marked as a duplicate of this issue. ***
*** Issue 83201 has been marked as a duplicate of this issue. ***
*** Issue 83309 has been marked as a duplicate of this issue. ***
*** Issue 84111 has been marked as a duplicate of this issue. ***
*** Issue 85031 has been marked as a duplicate of this issue. ***
*** Issue 75728 has been marked as a duplicate of this issue. ***
*** Issue 96046 has been marked as a duplicate of this issue. ***
*** Issue 106746 has been marked as a duplicate of this issue. ***
*** Issue 104237 has been marked as a duplicate of this issue. ***
*** Issue 157038 has been marked as a duplicate of this issue. ***