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

TextComponent.getSelectedText() does not work on Windows NT (Sparc - o'k)

XMLWordPrintable

    • x86
    • windows_nt

      Method getSelectedText() does not work near the end of a text located in TextArea on Windows NT, but works o'k on Sparc.
      It does not depend on what compiler was used (Sparc or WindowsNT).

      Files in attachments:
      ta.java - java source
      ta.class - compiled ta.java
      log.txt - log files (Windows NT and Sparc)
       
      On Windows NT:

      [N:/JAVA/BUGS/1997080601] n:/jdk1.1.3/bin/java.exe ta
      last_pos = 80
      cur_pos = 0
      cur_pos = 5
      cur_pos = 10
      ...
      cur_pos = 60
      cur_pos = 65
      java.lang.StringIndexOutOfBoundException: String index out of range: 82
              at java.lang.String.substring(String.java:1046)
              at java.awt.TextComponent.getSelectedText(TextComponent.java:122)
              at ta.<init>(ta.java:31)
              at ta.main(ta.java:38)

      On Solaris (Sparc):

      volga% pwd
      /home/nikm/JAVA/BUGS/1997080601
      volga% /opt/home/jdk1.1.2/bin/java ta
      last_pos = 80
      cur_pos = 0
      cur_pos = 5
      cur_pos = 10
      ...
      cur_pos = 60
      cur_pos = 65
      cur_pos = 70
      cur_pos = 75
      ^Cvolga%

      nikolay.molchanov@Eng 1997-08-07

            Unassigned Unassigned
            nmolchan Nikolay Molchanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: