case DataBuffer.TYPE_BYTE: {
// TODO: if the result is byte how does one subtract the pipeDepth form the value?
// Might not be even relevant with this use case
- return new Byte(((byte[]) r)[0]);
+ return Byte.valueOf(((byte[]) r)[0]);
}
case DataBuffer.TYPE_SHORT: // Fall through
case DataBuffer.TYPE_USHORT: // Fall through
case DataBuffer.TYPE_INT: {
int val = ((int[]) r)[0] - pipeDepthUnderGround;
- return new Integer(val);
+ return Integer.valueOf(val);
}
case DataBuffer.TYPE_FLOAT: {
float val = ((float[]) r)[0] - pipeDepthUnderGround;
- return new Float(val);
+ return Float.valueOf(val);
}
case DataBuffer.TYPE_DOUBLE: {
double val = ((double[]) r)[0] - pipeDepthUnderGround;
- return new Double(val);
+ return Double.valueOf(val);
}
default: return null;
}