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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • 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

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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: