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

java.io.StreamTokenizer.xxxChar(ch) methods do not check parameter

XMLWordPrintable

    • 1.1.1
    • sparc
    • solaris_2.5
    • Not verified



      Name: saC57035 Date: 12/15/96


      The java_io.StreamTokenizer.xxxChar(ch) methods work wrong if ch
      is out of range 0..255.
      They throw unexpected IndexOutOfBoundsException.

      Here is the example demonstrating the bug:
      ---- Test.java ----------------------
      import java.io.*;

      public class Test {

      public static void main( String argv[] ) {
       StreamTokenizer st = new StreamTokenizer(new StringBufferInputStream("TEST"));
       try {
         st.quoteChar(456);
         System.out.println("Test passed");
       } catch (Throwable e) {
         System.out.println("Test failed: "+e+" is thrown");
       }
      }

      }
      -- The output ----------------
      Test failed: java.lang.ArrayIndexOutOfBoundsException: 456 is thrown
      ------------------------------
      ======================================================================

            apalanissunw Anand Palaniswamy (Inactive)
            savzan Stanislav Avzan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: