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 it would not be incorrect according to 
the JDK 1.4 docs.

However, in the JCL, setLength() and other StringBuffer methods are 
explicitly defined to throw the StringIndexOutOfBoundsException.

Although I'm usually inclined to follow the Javadoc spec in preference 
to the JCL, given that there is some chance that changing it would break 
exisiting code, in this case I think it is safer to stick with the 
existing behaviour.

regards

Bryce.



_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to