db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dyre Tjeldvoll <Dyre.Tjeldv...@oracle.com>
Subject Question about DataType.invalidFormat()
Date Tue, 08 Jul 2014 12:14:31 GMT

This method returns an exception which is thrown by 
SQLInteger.setValue(String theValue) if the String passed in cannot be 
converted to an integer:

try {
		        value = Integer.parseInt(theValue.trim());
			} catch (NumberFormatException nfe) {
			    throw invalidFormat();

But when this situation occurs, it would have been really nice for the 
caller to be able to inspect the actual NumberFormatException which was 
thrown as that may say something about what is wrong with the String 
being passed in. So I would like to have an alternate 
invalidFormat(Exception cause) (assuming there are situations where 
there is no exception to use as cause) that captures the 
NumberFormatException as the thrown exception's cause... Would there be 
any backward compatibility issues with such a change?



View raw message