Program: 115365
Project: 115365
Buggy source:
@Override public Number bytesToValueRealOffset(byte[] data,int offset){
  offset*=2;
  if (dataType == DataType.TWO_BYTE_INT_UNSIGNED)   return new Integer(((data[offset] & 0xff) << 8) | (data[offset + 1] & 0xff));
  if (dataType == DataType.TWO_BYTE_INT_SIGNED)   return new Short((short)(((data[offset] & 0xff) << 8) | (data[offset + 1] & 0xff)));
  if (dataType == DataType.TWO_BYTE_INT_UNSIGNED_SWAPPED)   return new Integer(((data[offset + 1] & 0xff) << 8) | (data[offset] & 0xff));
  if (dataType == DataType.TWO_BYTE_INT_SIGNED_SWAPPED)   return new Short((short)(((data[offset + 1] & 0xff) << 8) | (data[offset] & 0xff)));
  if (dataType == DataType.TWO_BYTE_BCD) {
    StringBuilder sb=new StringBuilder();
    appendBCD(sb,data[offset]);
    appendBCD(sb,data[offset + 1]);
    return Short.parseShort(sb.toString());
  }
  if (dataType == DataType.FOUR_BYTE_INT_UNSIGNED)   return new Long(((long)((data[offset] & 0xff)) << 24) | ((long)((data[offset + 1] & 0xff)) << 16) | ((long)((data[offset + 2] & 0xff)) << 8)| ((data[offset + 3] & 0xff)));
  if (dataType == DataType.FOUR_BYTE_INT_SIGNED)   return new Integer(((data[offset] & 0xff) << 24) | ((data[offset + 1] & 0xff) << 16) | ((data[offset + 2] & 0xff) << 8)| (data[offset + 3] & 0xff));
  if (dataType == DataType.FOUR_BYTE_INT_UNSIGNED_SWAPPED)   return new Long(((long)((data[offset + 2] & 0xff)) << 24) | ((long)((data[offset + 3] & 0xff)) << 16) | ((long)((data[offset] & 0xff)) << 8)| ((data[offset + 1] & 0xff)));
  if (dataType == DataType.FOUR_BYTE_INT_SIGNED_SWAPPED)   return new Integer(((data[offset + 2] & 0xff) << 24) | ((data[offset + 3] & 0xff) << 16) | ((data[offset] & 0xff) << 8)| (data[offset + 1] & 0xff));
  if (dataType == DataType.FOUR_BYTE_INT_UNSIGNED_SWAPPED_SWAPPED)   return new Long(((long)((data[offset + 3] & 0xff)) << 24) | (((data[offset + 2] & 0xff) << 16)) | ((long)((data[offset + 1] & 0xff)) << 8)| (data[offset] & 0xff));
  if (dataType == DataType.FOUR_BYTE_INT_SIGNED_SWAPPED_SWAPPED)   return new Integer(((data[offset + 3] & 0xff) << 24) | ((data[offset + 2] & 0xff) << 16) | ((data[offset + 1] & 0xff) << 8)| ((data[offset] & 0xff)));
  if (dataType == DataType.FOUR_BYTE_FLOAT)   return Float.intBitsToFloat(((data[offset] & 0xff) << 24) | ((data[offset + 1] & 0xff) << 16) | ((data[offset + 2] & 0xff) << 8)| (data[offset + 3] & 0xff));
  if (dataType == DataType.FOUR_BYTE_FLOAT_SWAPPED)   return Float.intBitsToFloat(((data[offset + 2] & 0xff) << 24) | ((data[offset + 3] & 0xff) << 16) | ((data[offset] & 0xff) << 8)| (data[offset + 1] & 0xff));
  if (dataType == DataType.FOUR_BYTE_BCD) {
    StringBuilder sb=new StringBuilder();
    appendBCD(sb,data[offset]);
    appendBCD(sb,data[offset + 1]);
    appendBCD(sb,data[offset + 2]);
    appendBCD(sb,data[offset + 3]);
    return Integer.parseInt(sb.toString());
  }
  if (dataType == DataType.FOUR_BYTE_BCD_SWAPPED) {
    StringBuilder sb=new StringBuilder();
    appendBCD(sb,data[offset + 2]);
    appendBCD(sb,data[offset + 3]);
    appendBCD(sb,data[offset]);
    appendBCD(sb,data[offset + 1]);
    return Integer.parseInt(sb.toString());
  }
  if (dataType == DataType.FOUR_BYTE_MOD_10K)   return BigInteger.valueOf((((data[offset + 2] & 0xff) << 8) + (data[offset + 3] & 0xff))).multiply(BigInteger.valueOf(10000L)).add(BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))));
  if (dataType == DataType.FOUR_BYTE_MOD_10K_SWAPPED)   return BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))).multiply(BigInteger.valueOf(10000L)).add(BigInteger.valueOf((((data[offset + 2] & 0xff) << 8) + (data[offset + 3] & 0xff))));
  if (dataType == DataType.SIX_BYTE_MOD_10K)   return BigInteger.valueOf((((data[offset + 4] & 0xff) << 8) + (data[offset + 5] & 0xff))).multiply(BigInteger.valueOf(100000000L)).add(BigInteger.valueOf((((data[offset + 2] & 0xff) << 8) + (data[offset + 3] & 0xff))).multiply(BigInteger.valueOf(10000L))).add(BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))));
  if (dataType == DataType.SIX_BYTE_MOD_10K_SWAPPED)   return BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))).multiply(BigInteger.valueOf(100000000L)).add(BigInteger.valueOf((((data[offset + 2] & 0xff) << 8) + (data[offset + 3] & 0xff))).multiply(BigInteger.valueOf(10000L))).add(BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))));
  if (dataType == DataType.EIGHT_BYTE_MOD_10K)   return BigInteger.valueOf((((data[offset + 6] & 0xff) << 8) + (data[offset + 7] & 0xff))).multiply(BigInteger.valueOf(1000000000000L)).add(BigInteger.valueOf((((data[offset + 4] & 0xff) << 8) + (data[offset + 5] & 0xff))).multiply(BigInteger.valueOf(100000000L))).add(BigInteger.valueOf((((data[offset + 2] & 0xff) << 8) + (data[offset + 3] & 0xff))).multiply(BigInteger.valueOf(10000L))).add(BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))));
  if (dataType == DataType.EIGHT_BYTE_MOD_10K_SWAPPED)   return BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))).multiply(BigInteger.valueOf(1000000000000L)).add(BigInteger.valueOf((((data[offset + 2] & 0xff) << 8) + (data[offset + 3] & 0xff))).multiply(BigInteger.valueOf(100000000L))).add(BigInteger.valueOf((((data[offset + 4] & 0xff) << 8) + (data[offset + 5] & 0xff))).multiply(BigInteger.valueOf(10000L))).add(BigInteger.valueOf((((data[offset + 6] & 0xff) << 8) + (data[offset + 7] & 0xff))));
  if (dataType == DataType.EIGHT_BYTE_INT_UNSIGNED) {
    byte[] b9=new byte[9];
    System.arraycopy(data,offset,b9,1,8);
    return new BigInteger(b9);
  }
  if (dataType == DataType.EIGHT_BYTE_INT_SIGNED)   return new Long(((long)((data[offset] & 0xff)) << 56) | ((long)((data[offset + 1] & 0xff)) << 48) | ((long)((data[offset + 2] & 0xff)) << 40)| ((long)((data[offset + 3] & 0xff)) << 32)| ((long)((data[offset + 4] & 0xff)) << 24)| ((long)((data[offset + 5] & 0xff)) << 16)| ((long)((data[offset + 6] & 0xff)) << 8)| ((data[offset + 7] & 0xff)));
  if (dataType == DataType.EIGHT_BYTE_INT_UNSIGNED_SWAPPED) {
    byte[] b9=new byte[9];
    b9[1]=data[offset + 6];
    b9[2]=data[offset + 7];
    b9[3]=data[offset + 4];
    b9[4]=data[offset + 5];
    b9[5]=data[offset + 2];
    b9[6]=data[offset + 3];
    b9[7]=data[offset];
    b9[8]=data[offset + 1];
    return new BigInteger(b9);
  }
  if (dataType == DataType.EIGHT_BYTE_INT_SIGNED_SWAPPED)   return new Long(((long)((data[offset + 6] & 0xff)) << 56) | ((long)((data[offset + 7] & 0xff)) << 48) | ((long)((data[offset + 4] & 0xff)) << 40)| ((long)((data[offset + 5] & 0xff)) << 32)| ((long)((data[offset + 2] & 0xff)) << 24)| ((long)((data[offset + 3] & 0xff)) << 16)| ((long)((data[offset] & 0xff)) << 8)| ((data[offset + 1] & 0xff)));
  if (dataType == DataType.EIGHT_BYTE_FLOAT)   return Double.longBitsToDouble(((long)((data[offset] & 0xff)) << 56) | ((long)((data[offset + 1] & 0xff)) << 48) | ((long)((data[offset + 2] & 0xff)) << 40)| ((long)((data[offset + 3] & 0xff)) << 32)| ((long)((data[offset + 4] & 0xff)) << 24)| ((long)((data[offset + 5] & 0xff)) << 16)| ((long)((data[offset + 6] & 0xff)) << 8)| ((data[offset + 7] & 0xff)));
  if (dataType == DataType.EIGHT_BYTE_FLOAT_SWAPPED)   return Double.longBitsToDouble(((long)((data[offset + 6] & 0xff)) << 56) | ((long)((data[offset + 7] & 0xff)) << 48) | ((long)((data[offset + 4] & 0xff)) << 40)| ((long)((data[offset + 5] & 0xff)) << 32)| ((long)((data[offset + 2] & 0xff)) << 24)| ((long)((data[offset + 3] & 0xff)) << 16)| ((long)((data[offset] & 0xff)) << 8)| ((data[offset + 1] & 0xff)));
  throw new RuntimeException("String_Node_Str" + dataType);
}

Fixed version (ground truth):
@Override public Number bytesToValueRealOffset(byte[] data,int offset){
  offset*=2;
  if (dataType == DataType.TWO_BYTE_INT_UNSIGNED)   return new Integer(((data[offset] & 0xff) << 8) | (data[offset + 1] & 0xff));
  if (dataType == DataType.TWO_BYTE_INT_SIGNED)   return new Short((short)(((data[offset] & 0xff) << 8) | (data[offset + 1] & 0xff)));
  if (dataType == DataType.TWO_BYTE_INT_UNSIGNED_SWAPPED)   return new Integer(((data[offset + 1] & 0xff) << 8) | (data[offset] & 0xff));
  if (dataType == DataType.TWO_BYTE_INT_SIGNED_SWAPPED)   return new Short((short)(((data[offset + 1] & 0xff) << 8) | (data[offset] & 0xff)));
  if (dataType == DataType.TWO_BYTE_BCD) {
    StringBuilder sb=new StringBuilder();
    appendBCD(sb,data[offset]);
    appendBCD(sb,data[offset + 1]);
    return Short.parseShort(sb.toString());
  }
  if (dataType == DataType.FOUR_BYTE_INT_UNSIGNED)   return new Long(((long)((data[offset] & 0xff)) << 24) | ((long)((data[offset + 1] & 0xff)) << 16) | ((long)((data[offset + 2] & 0xff)) << 8)| ((data[offset + 3] & 0xff)));
  if (dataType == DataType.FOUR_BYTE_INT_SIGNED)   return new Integer(((data[offset] & 0xff) << 24) | ((data[offset + 1] & 0xff) << 16) | ((data[offset + 2] & 0xff) << 8)| (data[offset + 3] & 0xff));
  if (dataType == DataType.FOUR_BYTE_INT_UNSIGNED_SWAPPED)   return new Long(((long)((data[offset + 2] & 0xff)) << 24) | ((long)((data[offset + 3] & 0xff)) << 16) | ((long)((data[offset] & 0xff)) << 8)| ((data[offset + 1] & 0xff)));
  if (dataType == DataType.FOUR_BYTE_INT_SIGNED_SWAPPED)   return new Integer(((data[offset + 2] & 0xff) << 24) | ((data[offset + 3] & 0xff) << 16) | ((data[offset] & 0xff) << 8)| (data[offset + 1] & 0xff));
  if (dataType == DataType.FOUR_BYTE_INT_UNSIGNED_SWAPPED_SWAPPED)   return new Long(((long)((data[offset + 3] & 0xff)) << 24) | (((data[offset + 2] & 0xff) << 16)) | ((long)((data[offset + 1] & 0xff)) << 8)| (data[offset] & 0xff));
  if (dataType == DataType.FOUR_BYTE_INT_SIGNED_SWAPPED_SWAPPED)   return new Integer(((data[offset + 3] & 0xff) << 24) | ((data[offset + 2] & 0xff) << 16) | ((data[offset + 1] & 0xff) << 8)| ((data[offset] & 0xff)));
  if (dataType == DataType.FOUR_BYTE_FLOAT)   return Float.intBitsToFloat(((data[offset] & 0xff) << 24) | ((data[offset + 1] & 0xff) << 16) | ((data[offset + 2] & 0xff) << 8)| (data[offset + 3] & 0xff));
  if (dataType == DataType.FOUR_BYTE_FLOAT_SWAPPED)   return Float.intBitsToFloat(((data[offset + 2] & 0xff) << 24) | ((data[offset + 3] & 0xff) << 16) | ((data[offset] & 0xff) << 8)| (data[offset + 1] & 0xff));
  if (dataType == DataType.FOUR_BYTE_BCD) {
    StringBuilder sb=new StringBuilder();
    appendBCD(sb,data[offset]);
    appendBCD(sb,data[offset + 1]);
    appendBCD(sb,data[offset + 2]);
    appendBCD(sb,data[offset + 3]);
    return Integer.parseInt(sb.toString());
  }
  if (dataType == DataType.FOUR_BYTE_BCD_SWAPPED) {
    StringBuilder sb=new StringBuilder();
    appendBCD(sb,data[offset + 2]);
    appendBCD(sb,data[offset + 3]);
    appendBCD(sb,data[offset]);
    appendBCD(sb,data[offset + 1]);
    return Integer.parseInt(sb.toString());
  }
  if (dataType == DataType.FOUR_BYTE_MOD_10K)   return BigInteger.valueOf((((data[offset + 2] & 0xff) << 8) + (data[offset + 3] & 0xff))).multiply(BigInteger.valueOf(10000L)).add(BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))));
  if (dataType == DataType.FOUR_BYTE_MOD_10K_SWAPPED)   return BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))).multiply(BigInteger.valueOf(10000L)).add(BigInteger.valueOf((((data[offset + 2] & 0xff) << 8) + (data[offset + 3] & 0xff))));
  if (dataType == DataType.SIX_BYTE_MOD_10K)   return BigInteger.valueOf((((data[offset + 4] & 0xff) << 8) + (data[offset + 5] & 0xff))).multiply(BigInteger.valueOf(100000000L)).add(BigInteger.valueOf((((data[offset + 2] & 0xff) << 8) + (data[offset + 3] & 0xff))).multiply(BigInteger.valueOf(10000L))).add(BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))));
  if (dataType == DataType.SIX_BYTE_MOD_10K_SWAPPED)   return BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))).multiply(BigInteger.valueOf(100000000L)).add(BigInteger.valueOf((((data[offset + 2] & 0xff) << 8) + (data[offset + 3] & 0xff))).multiply(BigInteger.valueOf(10000L))).add(BigInteger.valueOf((((data[offset + 4] & 0xff) << 8) + (data[offset + 5] & 0xff))));
  if (dataType == DataType.EIGHT_BYTE_MOD_10K)   return BigInteger.valueOf((((data[offset + 6] & 0xff) << 8) + (data[offset + 7] & 0xff))).multiply(BigInteger.valueOf(1000000000000L)).add(BigInteger.valueOf((((data[offset + 4] & 0xff) << 8) + (data[offset + 5] & 0xff))).multiply(BigInteger.valueOf(100000000L))).add(BigInteger.valueOf((((data[offset + 2] & 0xff) << 8) + (data[offset + 3] & 0xff))).multiply(BigInteger.valueOf(10000L))).add(BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))));
  if (dataType == DataType.EIGHT_BYTE_MOD_10K_SWAPPED)   return BigInteger.valueOf((((data[offset] & 0xff) << 8) + (data[offset + 1] & 0xff))).multiply(BigInteger.valueOf(1000000000000L)).add(BigInteger.valueOf((((data[offset + 2] & 0xff) << 8) + (data[offset + 3] & 0xff))).multiply(BigInteger.valueOf(100000000L))).add(BigInteger.valueOf((((data[offset + 4] & 0xff) << 8) + (data[offset + 5] & 0xff))).multiply(BigInteger.valueOf(10000L))).add(BigInteger.valueOf((((data[offset + 6] & 0xff) << 8) + (data[offset + 7] & 0xff))));
  if (dataType == DataType.EIGHT_BYTE_INT_UNSIGNED) {
    byte[] b9=new byte[9];
    System.arraycopy(data,offset,b9,1,8);
    return new BigInteger(b9);
  }
  if (dataType == DataType.EIGHT_BYTE_INT_SIGNED)   return new Long(((long)((data[offset] & 0xff)) << 56) | ((long)((data[offset + 1] & 0xff)) << 48) | ((long)((data[offset + 2] & 0xff)) << 40)| ((long)((data[offset + 3] & 0xff)) << 32)| ((long)((data[offset + 4] & 0xff)) << 24)| ((long)((data[offset + 5] & 0xff)) << 16)| ((long)((data[offset + 6] & 0xff)) << 8)| ((data[offset + 7] & 0xff)));
  if (dataType == DataType.EIGHT_BYTE_INT_UNSIGNED_SWAPPED) {
    byte[] b9=new byte[9];
    b9[1]=data[offset + 6];
    b9[2]=data[offset + 7];
    b9[3]=data[offset + 4];
    b9[4]=data[offset + 5];
    b9[5]=data[offset + 2];
    b9[6]=data[offset + 3];
    b9[7]=data[offset];
    b9[8]=data[offset + 1];
    return new BigInteger(b9);
  }
  if (dataType == DataType.EIGHT_BYTE_INT_SIGNED_SWAPPED)   return new Long(((long)((data[offset + 6] & 0xff)) << 56) | ((long)((data[offset + 7] & 0xff)) << 48) | ((long)((data[offset + 4] & 0xff)) << 40)| ((long)((data[offset + 5] & 0xff)) << 32)| ((long)((data[offset + 2] & 0xff)) << 24)| ((long)((data[offset + 3] & 0xff)) << 16)| ((long)((data[offset] & 0xff)) << 8)| ((data[offset + 1] & 0xff)));
  if (dataType == DataType.EIGHT_BYTE_FLOAT)   return Double.longBitsToDouble(((long)((data[offset] & 0xff)) << 56) | ((long)((data[offset + 1] & 0xff)) << 48) | ((long)((data[offset + 2] & 0xff)) << 40)| ((long)((data[offset + 3] & 0xff)) << 32)| ((long)((data[offset + 4] & 0xff)) << 24)| ((long)((data[offset + 5] & 0xff)) << 16)| ((long)((data[offset + 6] & 0xff)) << 8)| ((data[offset + 7] & 0xff)));
  if (dataType == DataType.EIGHT_BYTE_FLOAT_SWAPPED)   return Double.longBitsToDouble(((long)((data[offset + 6] & 0xff)) << 56) | ((long)((data[offset + 7] & 0xff)) << 48) | ((long)((data[offset + 4] & 0xff)) << 40)| ((long)((data[offset + 5] & 0xff)) << 32)| ((long)((data[offset + 2] & 0xff)) << 24)| ((long)((data[offset + 3] & 0xff)) << 16)| ((long)((data[offset] & 0xff)) << 8)| ((data[offset + 1] & 0xff)));
  throw new RuntimeException("String_Node_Str" + dataType);
}