-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
1.1.4
-
sparc
-
solaris_2.5
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-4096341 java.lang.StringBuffer.getChars() does not work according with the spec
- Closed