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 75955 - AIOOBE from CloseButtonTabbedPane.sel
Summary: AIOOBE from CloseButtonTabbedPane.sel
Status: VERIFIED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: David Simonek
URL:
Keywords: JDK_SPECIFIC
: 72737 74500 75725 75728 76007 76737 76896 77620 79049 79163 79804 80012 80760 81550 82952 83201 83309 84111 85031 96046 104237 106746 157038 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-05 00:58 UTC by Jesse Glick
Modified: 2009-01-19 13:20 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
(initial) stack trace (3.88 KB, text/plain)
2006-05-05 00:59 UTC, Jesse Glick
Details
Possible workaround (prints debug info) (1.22 KB, patch)
2006-05-10 16:39 UTC, David Simonek
Details | Diff
improved patch (1.20 KB, patch)
2006-06-22 18:02 UTC, David Simonek
Details | Diff
JTabbedPane.getTitleAt() stack-trace (2.18 KB, text/plain)
2006-07-22 11:57 UTC, _ gtzabari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2006-05-05 00:58:30 UTC
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.
Comment 1 Jesse Glick 2006-05-05 00:59:29 UTC
Created attachment 30257 [details]
(initial) stack trace
Comment 2 Jesse Glick 2006-05-05 01:00:26 UTC
Using Mustang b82 in case that is the cause.
Comment 3 Marian Mirilovic 2006-05-09 07:04:51 UTC
*** Issue 76007 has been marked as a duplicate of this issue. ***
Comment 4 Marian Mirilovic 2006-05-09 07:07:32 UTC
JDK issue
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6420152
Comment 5 David Simonek 2006-05-10 09:46:11 UTC
Taking this one...
Comment 6 David Simonek 2006-05-10 16:33:32 UTC
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.
Comment 7 David Simonek 2006-05-10 16:35:30 UTC
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.
Comment 8 David Simonek 2006-05-10 16:39:10 UTC
Created attachment 30323 [details]
Possible workaround (prints debug info)
Comment 9 David Simonek 2006-05-10 16:47:42 UTC
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.
  
Comment 10 _ tboudreau 2006-05-10 18:36:18 UTC
+         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.  
Comment 11 David Simonek 2006-05-23 10:27:06 UTC
*** Issue 72737 has been marked as a duplicate of this issue. ***
Comment 12 _ alexlamsl 2006-05-23 10:32:30 UTC
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.
Comment 13 Milos Kleint 2006-05-23 10:53:34 UTC
*** Issue 75725 has been marked as a duplicate of this issue. ***
Comment 14 Milos Kleint 2006-05-23 15:13:56 UTC
*** Issue 76737 has been marked as a duplicate of this issue. ***
Comment 15 Jiri Prox 2006-06-09 12:43:48 UTC
*** Issue 77620 has been marked as a duplicate of this issue. ***
Comment 16 pbw 2006-06-09 18:57:41 UTC
What relevance, if any, is thre in the reference to  JDK 6368047 in the
discussion of JDK 6420152?
Comment 17 Milos Kleint 2006-06-12 09:44:28 UTC
*** Issue 76896 has been marked as a duplicate of this issue. ***
Comment 18 Jesse Glick 2006-06-14 20:01:25 UTC
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.
Comment 19 David Simonek 2006-06-20 16:58:04 UTC
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.
Comment 20 _ gtzabari 2006-06-20 20:13:13 UTC
Too bad this wasn't nailed before Sun released Mustang beta 2 :(
Comment 21 Antonin Nebuzelsky 2006-06-20 22:54:34 UTC
Dafe, please, proceed with integrating the workaround into 5.5.
Comment 22 David Simonek 2006-06-22 18:01:14 UTC
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
Comment 23 David Simonek 2006-06-22 18:02:08 UTC
Created attachment 31322 [details]
improved patch
Comment 24 David Simonek 2006-06-26 14:45:01 UTC
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
Comment 25 David Simonek 2006-06-28 16:42:57 UTC
*** Issue 79163 has been marked as a duplicate of this issue. ***
Comment 26 David Simonek 2006-06-28 16:45:07 UTC
*** Issue 79049 has been marked as a duplicate of this issue. ***
Comment 27 Jiri Prox 2006-07-07 11:51:56 UTC
*** Issue 79804 has been marked as a duplicate of this issue. ***
Comment 28 Milos Kleint 2006-07-13 08:14:28 UTC
*** Issue 80012 has been marked as a duplicate of this issue. ***
Comment 29 _ gtzabari 2006-07-22 11:56:13 UTC
I believe this issue is back, though the stack-trace looks a bit difference. I
got this stack-trace in dev build 200607201800.
Comment 30 _ gtzabari 2006-07-22 11:57:15 UTC
Created attachment 32113 [details]
JTabbedPane.getTitleAt() stack-trace
Comment 31 _ gtzabari 2006-07-22 12:00:15 UTC
Forgot to mention, I got this under Mustang b92.
Comment 32 Jiri Prox 2006-07-24 10:43:55 UTC
*** Issue 80760 has been marked as a duplicate of this issue. ***
Comment 33 David Simonek 2006-07-27 16:17:40 UTC
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.
Comment 34 Jiri Prox 2006-08-01 14:56:55 UTC
*** Issue 81550 has been marked as a duplicate of this issue. ***
Comment 35 Marian Mirilovic 2006-08-07 09:46:59 UTC
I tried NB dev (200608061800) with JDK 6.0 (b94) and it works fine.
Comment 36 David Simonek 2006-08-08 16:07:27 UTC
*** Issue 74500 has been marked as a duplicate of this issue. ***
Comment 37 Jan Becicka 2006-08-18 06:31:22 UTC
*** Issue 82952 has been marked as a duplicate of this issue. ***
Comment 38 Jiri Prox 2006-08-23 07:53:52 UTC
*** Issue 83201 has been marked as a duplicate of this issue. ***
Comment 39 David Simonek 2006-08-24 11:47:10 UTC
*** Issue 83309 has been marked as a duplicate of this issue. ***
Comment 40 Milos Kleint 2006-09-06 07:10:05 UTC
*** Issue 84111 has been marked as a duplicate of this issue. ***
Comment 41 Jiri Prox 2006-09-18 09:11:57 UTC
*** Issue 85031 has been marked as a duplicate of this issue. ***
Comment 42 Milos Kleint 2006-10-19 09:31:24 UTC
*** Issue 75728 has been marked as a duplicate of this issue. ***
Comment 43 Jiri Prox 2007-02-27 10:54:32 UTC
*** Issue 96046 has been marked as a duplicate of this issue. ***
Comment 44 Jiri Prox 2007-06-18 13:29:02 UTC
*** Issue 106746 has been marked as a duplicate of this issue. ***
Comment 45 David Simonek 2007-07-25 14:00:38 UTC
*** Issue 104237 has been marked as a duplicate of this issue. ***
Comment 46 Lukas Hasik 2009-01-19 13:20:43 UTC
*** Issue 157038 has been marked as a duplicate of this issue. ***