All tryToClose() methods should check for null arguments.

This commit is contained in:
akwizgran
2014-04-04 18:56:55 +01:00
parent 75f13f53a0
commit e260aac3d2
4 changed files with 10 additions and 6 deletions

View File

@@ -404,16 +404,16 @@ abstract class JdbcDatabase implements Database<Connection> {
}
private void tryToClose(ResultSet rs) {
if(rs != null) try {
rs.close();
try {
if(rs != null) rs.close();
} catch(SQLException e) {
if(LOG.isLoggable(WARNING))LOG.log(WARNING, e.toString(), e);
}
}
private void tryToClose(Statement s) {
if(s != null) try {
s.close();
try {
if(s != null) s.close();
} catch(SQLException e) {
if(LOG.isLoggable(WARNING))LOG.log(WARNING, e.toString(), e);
}