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

TextComponent.select(int, int) API description has a small error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.2.0
    • 1.2.0
    • client-libs
    • None
    • 1.2fcs
    • generic
    • generic
    • Not verified

      From page 1440 of "The Java Class Libraries, Second Edition, Volume 2"

      > DESCRIPTION: This method selects the text located between the positions
      > selStart and selEnd, inclusive.

      Actually, the selection is not inclusive. For example, select(0, 1) would
      select only one character, not two. If the selected string was "smiles",
      select(0, 1) would select "s". Similarly, select(1, 5) would select "mile",
      not "smile" or "miles".

      See the description of substring in "The Java Language Specification",
      section 20.12.32, page 543.

      See also bugids 4119768, 4118247

            ehawkessunw Eric Hawkes (Inactive)
            ehawkessunw Eric Hawkes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: