StringBuffer question

2002-03-06 Thread Eric Blake
How strictly do we want to match Sun on StringBuffer? In the 1.4 Javadoc, many of the methods specify only @throws IndexOutOfBoundsException, which can be done as a side-effect of array operations. Yet the JDK implementation seems to throw StringIndexOutOfBoundsException (a subclass), which

Re: StringBuffer question

2002-03-06 Thread Brian Jones
Eric Blake [EMAIL PROTECTED] writes: How strictly do we want to match Sun on StringBuffer? In the 1.4 Javadoc, many of the methods specify only @throws IndexOutOfBoundsException, which can be done as a side-effect of array operations. Yet the JDK implementation seems to throw

Re: StringBuffer question

2002-03-06 Thread Bryce McKinlay
Eric Blake wrote: So back to my original question: Is the bounds check in the current Classpath implementation of setLength necessary, or am I justified in breaking the above snippet by removing the bounds check and throwing IndexOutOfBoundsException instead? Iit would be nice to do that, and

Re: StringBuffer question

2002-03-06 Thread Eric Blake
Bryce McKinlay wrote: However, in the JCL, setLength() and other StringBuffer methods are explicitly defined to throw the StringIndexOutOfBoundsException. Thanks for the clarification. I will document the methods in question as: * @throws IndexOutOfBoundsException description... *