提交 0e1a06c2 编写于 作者: T terrymanu

fix bug: getBoolean null => false

上级 1b86d409
......@@ -64,6 +64,8 @@ public final class ResultSetUtil {
private static Object convertNullValue(final Class<?> convertType) {
switch (convertType.getName()) {
case "boolean":
return false;
case "byte":
return (byte) 0;
case "short":
......@@ -72,10 +74,10 @@ public final class ResultSetUtil {
return 0;
case "long":
return 0L;
case "double":
return 0D;
case "float":
return 0F;
case "double":
return 0D;
default:
return null;
}
......
......@@ -61,6 +61,7 @@ public final class ResultSetUtilTest {
@Test
public void assertConvertNullValue() {
assertThat(ResultSetUtil.convertValue(null, boolean.class), is((Object) false));
assertThat(ResultSetUtil.convertValue(null, byte.class), is((Object) (byte) 0));
assertThat(ResultSetUtil.convertValue(null, short.class), is((Object) (short) 0));
assertThat(ResultSetUtil.convertValue(null, int.class), is((Object) 0));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册