JDK-4287053 : General Exception checking in JTabbedPane.java methods.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.2.2
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_2.6,windows_nt
  • CPU: x86,sparc
  • Submitted: 1999-11-02
  • Updated: 2001-01-17
  • Resolved: 2001-01-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
1.4.0 betaFixed
Related Reports
Relates :  
Relates :  
While testing JTabbedPane.removeTabAt(int index) I found that an ArrayIndexOutOfBoundsException was thrown when index is great then
tabCount size. If the user has 2 tabs and tries to removeTabAt(-1)
you get an ArrayIndexOutOfBoundsException. Also if the user tries to
removeTabAt(5) an ArrayIndexOutOfBoundsException gets thrown. Yet in the remove(Component component) if we make a call to remove(notAComponentInTabbedPane) the it does nothing. No ArrayIndexOutOfBoundsException was thrown. It appears to be inconsistent between
the two remove methods and the docs. This is manifested in most of the methods in JTabbedPane. I am filing one bug on this. The docs do not make reference to Exception handling yet we throw ArrayIndexOutOfBoundsException; but in remove() method we silently pass the call and don't throw an Exception. How should this work.

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin merlin-beta FIXED IN: merlin-beta INTEGRATED IN: merlin-beta

SUGGESTED FIX We should test the bounds of the methods and either silently do nothing or throw an IllegalArgumentException. We should also update the java docs for this as well. I have tested this is my source base and it seems like this will not affect other areas.

EVALUATION It's true - the exception handling is completely inconsistent across all the methods. We should make it consistent and document appropriately. amy.fowler@Eng 2000-12-14