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

cleanup - avoid unnecessary boxing

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