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

Replace method in StringBuffer in JDK1.2 does not truncate properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.2.0
    • core-libs
    • x86
    • windows_nt



      Name: dbT83986 Date: 02/25/99


      I am trying to use the replace method in StringBuffer. When the new string's
      length is smaller than the length of the characters that I am replacing in the
      StringBuffer it does not truncate appropriately.

      eg.
      StringBuffer xxx = new StringBuffer("This is a test");
      xxx = replace(5, 10, "xxx");
      System.out.println(xxx);

      This returns the following :
      Thisxxx a test
      (Review ID: 48667)
      ======================================================================

            mmcclosksunw Michael Mccloskey (Inactive)
            dblairsunw Dave Blair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: