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

Specification for JList.addSelectionInterval() must be clarified

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b94
    • CPU:
      generic
    • OS:
      generic

      Description

      Updated specification for javax.swing.JList method "addSelectionInterval(int index0, int index1)" contains two assertions:

      "This method does nothing if either index is -1."
      and
      "If either index is less than -1, an IndexOutOfBoundsException is thrown."

      The second sentence must mention that it's true only if another index != -1, i.e. this two sentences must be tightly linked together or combined into one.
      Currently

              new JList().addSelectionInterval(-3, -1);

      would not throw exception and this behavior looks very confusing.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shickeysunw Shannon Hickey (Inactive)
              Reporter:
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: