-
Bug
-
Resolution: Fixed
-
P3
-
1.1.4, 1.1.5
-
1.2beta3
-
x86, sparc
-
solaris_2.5, windows_nt
-
Not verified
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.
======================================================================
- duplicates
-
JDK-4096456 java.lang.StringBuffer.getChars() does not work according with the spec
- Closed
-
JDK-4125988 In getChars(), if srcBegin > srcEnd, IndexOutOfBoundsException is not thrown.
- Closed