Fix #208 little bit cleaner impl of unwrap() and isWrapper()

pull/212/head
Brett Wooldridge 10 years ago
parent a4c6c03ded
commit 44ecfd7f01

@ -178,7 +178,7 @@ public class HikariDataSource extends HikariConfig implements DataSource, Closea
@SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException
{
if (iface == this.getClass()) {
if (iface.isInstance(this)) {
return (T) this;
}
else if (pool != null) {
@ -197,7 +197,7 @@ public class HikariDataSource extends HikariConfig implements DataSource, Closea
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException
{
if (iface == this.getClass()) {
if (iface.isInstance(this)) {
return true;
}
else if (pool != null) {

Loading…
Cancel
Save