commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: [DBCP] DelegatingDatabaseMetaData returns null for @NonNull methods
Date Mon, 23 Nov 2009 16:24:58 GMT
sebb wrote:
> Findbugs has lots of complaints that the DelegatingDatabaseMetaData
> class methods may return null for methods which should be @NonNull.
> 
> These are all of the form:
> 
>     public String getSchemaTerm() throws SQLException {
>         { try { return _meta.getSchemaTerm(); }
>         catch (SQLException e) { handleException(e); return null; } }
>     }
> 
> Now the handleException() method never returns, it always throws an
> exception, so the return statement cannot be reached.
> 
> Seems to me it would be clearer to replace the return statements with
> an assertion exception.
> 
> WDYT?

+1

Mark




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message