(1.1) java.io.StringWriter.write(str,int,int) allows out of bounds case

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.2.0
    • Component/s: core-libs
    • generic
    • generic



      Name: bb33257 Date: 06/28/98


      It would expect an IndexOutOfBoundsException when I call StringWriter
      with a string and out of bounds parameters, as below.

      No exception is thrown in this case.
      -----------------------------
      import java.io.*;
      public class SWWrite {
        public static void main(String[] args) throws IOException {
          int result;
          String str = "abcefgh";
          StringWriter sw = new StringWriter();
          sw.write(str, 5, 5);
        }//end of main

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

            Assignee:
            Iris Clark
            Reporter:
            Brian Beck (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: