提交 863293f5 authored 作者: Jacek Ławrynowicz's avatar Jacek Ławrynowicz

cleanup - avoid unnecessary boxing

上级 576c7efd
......@@ -258,7 +258,7 @@ public class JdbcArray extends TraceObject implements Array {
// TODO array result set: there are multiple data types possible
rs.addColumn("VALUE", Types.NULL, 0, 0);
for (int i = 0; i < array.length; i++) {
rs.addRow(Long.valueOf(offset + i + 1), array[i]);
rs.addRow(offset + i + 1, array[i]);
}
return rs;
}
......
......@@ -601,7 +601,7 @@ public class ObjectDataType implements DataType {
@Override
public Object read(ByteBuffer buff, int tag) {
return Byte.valueOf(buff.get());
return buff.get();
}
}
......@@ -642,7 +642,7 @@ public class ObjectDataType implements DataType {
@Override
public Object read(ByteBuffer buff, int tag) {
return Character.valueOf(buff.getChar());
return buff.getChar();
}
}
......@@ -683,7 +683,7 @@ public class ObjectDataType implements DataType {
@Override
public Object read(ByteBuffer buff, int tag) {
return Short.valueOf(buff.getShort());
return buff.getShort();
}
}
......@@ -811,7 +811,7 @@ public class ObjectDataType implements DataType {
case TAG_LONG_FIXED:
return buff.getLong();
}
return Long.valueOf(tag - TAG_LONG_0_7);
return (long) (tag - TAG_LONG_0_7);
}
}
......
......@@ -183,8 +183,8 @@ public class MultiDimension implements Comparator<long[]> {
Long[] from = new Long[len];
Long[] to = new Long[len];
for (int i = 0; i < len; i++) {
from[i] = Long.valueOf(ranges[i][0]);
to[i] = Long.valueOf(ranges[i][1]);
from[i] = ranges[i][0];
to[i] = ranges[i][1];
}
prep.setObject(1, from);
prep.setObject(2, to);
......
......@@ -1335,19 +1335,19 @@ public class DataType {
if (clazz == Boolean.TYPE) {
return Boolean.FALSE;
} else if (clazz == Byte.TYPE) {
return Byte.valueOf((byte) 0);
return (byte) 0;
} else if (clazz == Character.TYPE) {
return Character.valueOf((char) 0);
return (char) 0;
} else if (clazz == Short.TYPE) {
return Short.valueOf((short) 0);
return (short) 0;
} else if (clazz == Integer.TYPE) {
return Integer.valueOf(0);
return 0;
} else if (clazz == Long.TYPE) {
return Long.valueOf(0);
return 0L;
} else if (clazz == Float.TYPE) {
return Float.valueOf(0);
return (float) 0;
} else if (clazz == Double.TYPE) {
return Double.valueOf(0);
return (double) 0;
}
throw DbException.throwInternalError(
"primitive=" + clazz.toString());
......
......@@ -130,7 +130,7 @@ public class ValueByte extends Value {
@Override
public Object getObject() {
return Byte.valueOf(value);
return value;
}
@Override
......
......@@ -139,7 +139,7 @@ public class ValueDouble extends Value {
@Override
public Object getObject() {
return Double.valueOf(value);
return value;
}
@Override
......
......@@ -139,7 +139,7 @@ public class ValueFloat extends Value {
@Override
public Object getObject() {
return Float.valueOf(value);
return value;
}
@Override
......
......@@ -130,7 +130,7 @@ public class ValueShort extends Value {
@Override
public Object getObject() {
return Short.valueOf(value);
return value;
}
@Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论