[3024] in java-interest

home help back first fref pref prev next nref lref last post

String.substring lies about what exceptions is throws

daemon@ATHENA.MIT.EDU (Jonathan Payne)
Thu Oct 26 22:56:30 1995

Date: Thu, 26 Oct 1995 11:25:27 -0700
From: jpayne@starwave.com (Jonathan Payne)
To: java-interest@java.Eng.Sun.COM

	
    public String substring(int beginIndex, int endIndex) {
	if (beginIndex > endIndex) {
	    int tmp = beginIndex;
	    beginIndex = endIndex;
	    endIndex = tmp;
	}
	if (beginIndex < 0) {
	    throw new StringIndexOutOfBoundsException(beginIndex);
	} 
	if (endIndex > count) {
	    throw new StringIndexOutOfBoundsException(endIndex);
	}
	return ((beginIndex == 0) && (endIndex == count)) ? this :
		   new String(value, offset + beginIndex, endIndex - beginIndex);
    }

It doesn't declare it's throwing any exceptions ...  Was the prebeta
release compiled with the prebeta compiler?  I think not.
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post