提交 3f73a7a6 authored 作者: Noel Grandin's avatar Noel Grandin

fix some TestCrashAPI issues

上级 2962ea18
...@@ -3094,10 +3094,14 @@ public class JdbcDatabaseMetaData extends TraceObject implements ...@@ -3094,10 +3094,14 @@ public class JdbcDatabaseMetaData extends TraceObject implements
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
try {
if (isWrapperFor(iface)) { if (isWrapperFor(iface)) {
return (T) this; return (T) this;
} }
throw DbException.getInvalidValueException("iface", iface); throw DbException.getInvalidValueException("iface", iface);
} catch (Exception e) {
throw logAndConvert(e);
}
} }
/** /**
......
...@@ -227,10 +227,14 @@ public class JdbcParameterMetaData extends TraceObject implements ...@@ -227,10 +227,14 @@ public class JdbcParameterMetaData extends TraceObject implements
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
try {
if (isWrapperFor(iface)) { if (isWrapperFor(iface)) {
return (T) this; return (T) this;
} }
throw DbException.getInvalidValueException("iface", iface); throw DbException.getInvalidValueException("iface", iface);
} catch (Exception e) {
throw logAndConvert(e);
}
} }
/** /**
......
...@@ -3683,10 +3683,14 @@ public class JdbcResultSet extends TraceObject implements ResultSet, JdbcResultS ...@@ -3683,10 +3683,14 @@ public class JdbcResultSet extends TraceObject implements ResultSet, JdbcResultS
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
try {
if (isWrapperFor(iface)) { if (isWrapperFor(iface)) {
return (T) this; return (T) this;
} }
throw DbException.getInvalidValueException("iface", iface); throw DbException.getInvalidValueException("iface", iface);
} catch (Exception e) {
throw logAndConvert(e);
}
} }
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论