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

java.lang.StringBuffer.getChars() does not work according with the spec

    XMLWordPrintable

Details

    • 1.2beta3
    • x86, sparc
    • solaris_2.5, windows_nt
    • Not verified

    Description



      Name: mgC56079 Date: 12/02/97


      The method StringBuffer.getChars(int srcBegin, int srcEnd, char[]dst, int dstBegin)
      does not match the spec.
      The JLS v1.0 (20.13.11) says that the exception will be thrown if srcBegin > srcEnd.
      The implementation does nothig in this case.

      --- Here is the example (S.java) ---
      public class S {
        public static void main(String ar[]) {
          StringBuffer sb=new StringBuffer("String");
          char[] arr=new char[10];
          sb.getChars(1,0,arr,0); //expecting exception
        }
      }

      This test should throw an exception.

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

      Attachments

        Issue Links

          Activity

            People

              apalanissunw Anand Palaniswamy (Inactive)
              mgorshen Mikhail Gorshenev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: