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

XMLWordPrintable

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: P4
    • None
    • Affects Version/s: 1.2.0
    • Component/s: 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)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: