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
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
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
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...
*
4 matches
Mail list logo