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

getAfterIndex(AccessibleText.SENTENCE, ...) works wrong

    Details

      Description

      Name: ssR10000 Date: 10/23/2003


      Filed By : SPB JCK team (###@###.###)
      JDK : java full version "1.5.0-beta-b24"
      JCK : 1.5
      Platform[s] : Solaris
      switch/Mode :
      JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
      Failing Test [s] : N/A


      Specification excerpt:
      ======================
      --------- J2SE API spec v.1.5 ---------
      ...
      This is all about javax.swing.AbstractButton.AccessibleAbstractButton and
       javax.swing.JLabel.AccessibleJLabel classes but it is really possible that other classes have the same problems.


      The 1.5 JavaAPI spec. says:

      public String getAfterIndex(int part, int index)

      Returns the String after a given index.

      Parameters:
      part - the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieve
      index - an index within the text >= 0
      Returns:
      the letter, word, or sentence, null for an invalid index or part
      ...
      ---------- end-of-excerpt ---------------

      Problem description
      ===================
      It is looks like that method always return null if part=AccessibleText.SENTENCE (Test.java)

          
      Minimized test:
      ===============
      ------- Test.java -------
      import javax.swing.*;
      import javax.accessibility.*;

      public class Test {

          public static void main(String[] argv) {
              JLabel o = new JLabel("<html><body><p>Test1 test2 test3. Test4. test5 </p></body></html>");

              AccessibleText c = o.getAccessibleContext().getAccessibleText();
      System.out.println(c);

              for (int i = 1; i < 45; i++) {
                  System.out.println(c.getAfterIndex(AccessibleText.SENTENCE, i));
              }
          }
      }
      ------- end-of-Test.java -------

      Minimized test output:
      ======================
      <ssw@archer(screen:5).266> java Test
      javax.swing.JLabel$AccessibleJLabel@1e328e0
      null
      null
      ...
      ...
      null
      null
      <ssw@archer(screen:5).267>

      The following JCK test failed due to this problem:

      api/javax_swing/AbstractButton/AccessibleAbstractButton/index.html#AccessibleText[AccessibleAbstractButton0024]

      api/javax_swing/JLabel/AccessibleJLabel/index.html#AccessibleText[AccessibleJLabel0015]

      JCK test source location:
      ==========================
      /java/re/jck/1.5/promoted/latest/JCK-runtime-15/tests

      ======================================================================
      ###@###.### 10/15/04 17:31 GMT

        Attachments

          Activity

            People

            • Assignee:
              lmonsantsunw Lynn Monsanto (Inactive)
              Reporter:
              sswsunw Ssw Ssw (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: