This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: String.getChars behaviour differs from Sun implementation


>>>>> "Erwin" == Erwin Bolwidt <ejb@klomp.org> writes:

Erwin> 		char[] array = new char[0];
Erwin> 		"foo".getChars(0, 3, array, 0);

Erwin> But it seems logical to me that you get a
Erwin> StringIndexOutOfBoundsException if the first two parameters of
Erwin> the getChars method are wrong (they point to the start and end
Erwin> character within the string) and an
Erwin> ArrayIndexOutOfBoundsException if the array is too small or the
Erwin> last argument, the start index in the array, is negative or too
Erwin> big.

I agree.  This seems like the most logical approach to me as well.  I
have a patch for this which I'll check in soon.  I'm only going to put
it on the trunk though.  I don't think this is critical enough for
3.0.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]