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

Specification for JList.addSelectionInterval() must be clarified

XMLWordPrintable

    • b94
    • generic
    • generic

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: