mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-10 05:04:52 +00:00
HHH-9136 - DatabaseMetadata: NPE hides exception in finally block
- Protection against NPE in finally block - Little formatting fixes
This commit is contained in:
parent
f693f5c320
commit
ee8f26a4be
@ -149,9 +149,11 @@ else if ( (isQuoted && meta.storesLowerCaseQuotedIdentifiers())
|
|||||||
|
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
if ( rs != null ) {
|
||||||
rs.close();
|
rs.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (SQLException sqlException) {
|
catch (SQLException sqlException) {
|
||||||
throw new SqlExceptionHelper( sqlExceptionConverter )
|
throw new SqlExceptionHelper( sqlExceptionConverter )
|
||||||
.convert( sqlException, "could not get table metadata: " + name );
|
.convert( sqlException, "could not get table metadata: " + name );
|
||||||
@ -180,10 +182,13 @@ private void initSequences(Connection connection, Dialect dialect) throws SQLExc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
if ( rs != null ) {
|
||||||
rs.close();
|
rs.close();
|
||||||
|
}
|
||||||
|
if ( statement != null ) {
|
||||||
statement.close();
|
statement.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user