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

SPEC BUG: java.awt.TextComponent 5 issues

    Details

    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      generic, sparc
    • OS:
      generic, solaris_2.6
    • Verification:
      Verified

      Description



      Name: sdR10048 Date: 10/17/2003


      Filed By : SPB JCK team (###@###.###)
      JDK : java full version "1.5.0-beta-b23"

      Specification excerpt:
      ======================
      --------- J2SE API spec v.1.5 ---------
      ...
      public void setCaretPosition(int position)
      Sets the position of the text insertion caret for this text component.
      The caret position is constrained to be at or before the current
      selection end. If the caller supplies a value for position that is
      greater than the end of the component's text, the caret position
      is set to the end of the component's text. This happens silently
      and without failure. The caret position also cannot be set to less
      than zero, the beginning of the component's text. If the caller
      supplies a value for position that is less than zero, an I
      llegalArgumentException is thrown.

      Parameters:
      position - the position of the text insertion caret
      Throws:
      IllegalArgumentException - if the value supplied for position is less than zero

      ===

      public int getCaretPosition()
      Gets the position of the text insertion caret for this text component.

      Returns:
      the position of the text insertion caret

      ===

      public String getText()
      Returns the text that is presented by this text component.

      ...
      ---------- end-of-excerpt ---------------

      Problem description
      ===================
      The spec for the designated methods does not document some issues:

      1. the default component's text value if it has not been set before

      2. expected behaviour for setCaretPosition if text has not been set before

      3. expected behaviour for getCaretPosition if text has not been set before

      4. expected behaviour for getCaretPosition if caret position has not been set before

      5. expected behaviour for getCaretPosition if text has been changed
         so the caret position is out of the new text bounds

      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sharonz Sharon Zakhour (Inactive)
                Reporter:
                dsvsunw Dsv Dsv (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: