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

JavaDoc of index parameter of method JTabbedPane.insertTab

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 20
    • client-libs
    • None
    • behavioral
    • minimal
    • Hide
      Minimal changes of Java Doc.

      Changing specification to match behavior.
      Show
      Minimal changes of Java Doc. Changing specification to match behavior.
    • Java API
    • SE

      Summary

      Correct the specification of JTabbedPane.insertTab() to say that an index of 0 is allowed.

      Problem

      The specification of JTabbedPane.insertTab() incorrectly states that the index parameter must be > 0. This is not only incorrect but inconsistent with the throws clause

      Solution

      Java Doc is updated for the index parameter range, from > 0 to >= 0.

      Specification

      class javax.swing.JTabbedPane

                * @param index the position to insert this new tab
          -     *       ({@code > 0 and <= getTabCount()})
          +     *        {@code (index >= 0 && index <= getTabCount())}
                *
                * @throws IndexOutOfBoundsException if the index is out of range
      -     *         ({@code < 0 or > getTabCount()})
      +     *         {@code (index < 0 || index > getTabCount())}
          public void insertTab(String title, Icon icon, Component component, String tip, int index) {

            tr Tejesh R
            webbuggrp Webbug Group
            Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: