Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4287053

General Exception checking in JTabbedPane.java methods.

    Details

    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      x86, sparc
    • OS:
      solaris_2.6, windows_nt

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                amfowler Anne Fowler (Inactive)
                Reporter:
                collins Gary Collins (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: