Program: 115364
Project: 115364
Buggy source:
@Override public short[] valueToShorts(Number value){
  if (dataType == DataType.TWO_BYTE_INT_UNSIGNED || dataType == DataType.TWO_BYTE_INT_SIGNED)   return new short[]{toShort(value)};
  if (dataType == DataType.TWO_BYTE_INT_SIGNED_SWAPPED || dataType == DataType.TWO_BYTE_INT_UNSIGNED_SWAPPED) {
    short sval=toShort(value);
    return new short[]{(short)(((sval & 0xFF00) >> 8) | ((sval & 0x00FF) << 8))};
  }
  if (dataType == DataType.TWO_BYTE_BCD) {
    short s=toShort(value);
    return new short[]{(short)((((s / 1000) % 10) << 12) | (((s / 100) % 10) << 8) | (((s / 10) % 10) << 4)| (s % 10))};
  }
  if (dataType == DataType.FOUR_BYTE_INT_UNSIGNED || dataType == DataType.FOUR_BYTE_INT_SIGNED) {
    int i=toInt(value);
    return new short[]{(short)(i >> 16),(short)i};
  }
  if (dataType == DataType.FOUR_BYTE_INT_UNSIGNED_SWAPPED || dataType == DataType.FOUR_BYTE_INT_SIGNED_SWAPPED) {
    int i=toInt(value);
    return new short[]{(short)i,(short)(i >> 16)};
  }
  if (dataType == DataType.FOUR_BYTE_INT_SIGNED_SWAPPED_SWAPPED || dataType == DataType.FOUR_BYTE_INT_UNSIGNED_SWAPPED_SWAPPED) {
    int i=toInt(value);
    short topWord=(short)(((i & 0xFF) << 8) | ((i >> 8) & 0xFF));
    short bottomWord=(short)(((i >> 24) & 0x000000FF) | ((i >> 8) & 0x0000FF00));
    return new short[]{topWord,bottomWord};
  }
  if (dataType == DataType.FOUR_BYTE_FLOAT) {
    int i=Float.floatToIntBits(value.floatValue());
    return new short[]{(short)(i >> 16),(short)i};
  }
  if (dataType == DataType.FOUR_BYTE_FLOAT_SWAPPED) {
    int i=Float.floatToIntBits(value.floatValue());
    return new short[]{(short)i,(short)(i >> 16)};
  }
  if (dataType == DataType.FOUR_BYTE_BCD) {
    int i=toInt(value);
    return new short[]{(short)((((i / 10000000) % 10) << 12) | (((i / 1000000) % 10) << 8) | (((i / 100000) % 10) << 4)| ((i / 10000) % 10)),(short)((((i / 1000) % 10) << 12) | (((i / 100) % 10) << 8) | (((i / 10) % 10) << 4)| (i % 10))};
  }
  if (dataType == DataType.FOUR_BYTE_MOD_10K_SWAPPED) {
    long l=value.longValue();
    return new short[]{(short)((l / 10000) % 10000),(short)(l % 10000)};
  }
  if (dataType == DataType.FOUR_BYTE_MOD_10K) {
    long l=value.longValue();
    return new short[]{(short)(l % 10000),(short)((l / 10000) % 10000)};
  }
  if (dataType == DataType.SIX_BYTE_MOD_10K) {
    long l=value.longValue();
    return new short[]{(short)((l / 100000000L) % 10000),(short)((l / 10000) % 10000),(short)(l % 10000)};
  }
  if (dataType == DataType.SIX_BYTE_MOD_10K_SWAPPED) {
    long l=value.longValue();
    return new short[]{(short)(l % 10000),(short)((l / 10000) % 10000),(short)((l / 100000000L) % 10000)};
  }
  if (dataType == DataType.EIGHT_BYTE_MOD_10K) {
    long l=value.longValue();
    return new short[]{(short)((l / 1000000000000L) % 10000),(short)((l / 100000000L) % 10000),(short)((l / 10000) % 10000),(short)(l % 10000)};
  }
  if (dataType == DataType.EIGHT_BYTE_MOD_10K_SWAPPED) {
    long l=value.longValue();
    return new short[]{(short)(l % 10000),(short)((l / 10000) % 10000),(short)((l / 100000000L) % 10000),(short)((l / 1000000000000L) % 10000)};
  }
  if (dataType == DataType.EIGHT_BYTE_INT_UNSIGNED || dataType == DataType.EIGHT_BYTE_INT_SIGNED) {
    long l=value.longValue();
    return new short[]{(short)(l >> 48),(short)(l >> 32),(short)(l >> 16),(short)l};
  }
  if (dataType == DataType.EIGHT_BYTE_INT_UNSIGNED_SWAPPED || dataType == DataType.EIGHT_BYTE_INT_SIGNED_SWAPPED) {
    long l=value.longValue();
    return new short[]{(short)l,(short)(l >> 16),(short)(l >> 32),(short)(l >> 48)};
  }
  if (dataType == DataType.EIGHT_BYTE_FLOAT) {
    long l=Double.doubleToLongBits(value.doubleValue());
    return new short[]{(short)(l >> 48),(short)(l >> 32),(short)(l >> 16),(short)l};
  }
  if (dataType == DataType.EIGHT_BYTE_FLOAT_SWAPPED) {
    long l=Double.doubleToLongBits(value.doubleValue());
    return new short[]{(short)l,(short)(l >> 16),(short)(l >> 32),(short)(l >> 48)};
  }
  throw new RuntimeException("String_Node_Str" + dataType);
}

Fixed version (ground truth):
@Override public short[] valueToShorts(Number value){
  if (dataType == DataType.TWO_BYTE_INT_UNSIGNED || dataType == DataType.TWO_BYTE_INT_SIGNED)   return new short[]{toShort(value)};
  if (dataType == DataType.TWO_BYTE_INT_SIGNED_SWAPPED || dataType == DataType.TWO_BYTE_INT_UNSIGNED_SWAPPED) {
    short sval=toShort(value);
    return new short[]{(short)(((sval & 0xFF00) >> 8) | ((sval & 0x00FF) << 8))};
  }
  if (dataType == DataType.TWO_BYTE_BCD) {
    short s=toShort(value);
    return new short[]{(short)((((s / 1000) % 10) << 12) | (((s / 100) % 10) << 8) | (((s / 10) % 10) << 4)| (s % 10))};
  }
  if (dataType == DataType.FOUR_BYTE_INT_UNSIGNED || dataType == DataType.FOUR_BYTE_INT_SIGNED) {
    int i=toInt(value);
    return new short[]{(short)(i >> 16),(short)i};
  }
  if (dataType == DataType.FOUR_BYTE_INT_UNSIGNED_SWAPPED || dataType == DataType.FOUR_BYTE_INT_SIGNED_SWAPPED) {
    int i=toInt(value);
    return new short[]{(short)i,(short)(i >> 16)};
  }
  if (dataType == DataType.FOUR_BYTE_INT_SIGNED_SWAPPED_SWAPPED || dataType == DataType.FOUR_BYTE_INT_UNSIGNED_SWAPPED_SWAPPED) {
    int i=toInt(value);
    short topWord=(short)(((i & 0xFF) << 8) | ((i >> 8) & 0xFF));
    short bottomWord=(short)(((i >> 24) & 0x000000FF) | ((i >> 8) & 0x0000FF00));
    return new short[]{topWord,bottomWord};
  }
  if (dataType == DataType.FOUR_BYTE_FLOAT) {
    int i=Float.floatToIntBits(value.floatValue());
    return new short[]{(short)(i >> 16),(short)i};
  }
  if (dataType == DataType.FOUR_BYTE_FLOAT_SWAPPED) {
    int i=Float.floatToIntBits(value.floatValue());
    return new short[]{(short)i,(short)(i >> 16)};
  }
  if (dataType == DataType.FOUR_BYTE_BCD) {
    int i=toInt(value);
    return new short[]{(short)((((i / 10000000) % 10) << 12) | (((i / 1000000) % 10) << 8) | (((i / 100000) % 10) << 4)| ((i / 10000) % 10)),(short)((((i / 1000) % 10) << 12) | (((i / 100) % 10) << 8) | (((i / 10) % 10) << 4)| (i % 10))};
  }
  if (dataType == DataType.FOUR_BYTE_MOD_10K_SWAPPED) {
    long l=value.longValue();
    return new short[]{(short)((l / 10000) % 10000),(short)(l % 10000)};
  }
  if (dataType == DataType.FOUR_BYTE_MOD_10K) {
    long l=value.longValue();
    return new short[]{(short)(l % 10000),(short)((l / 10000) % 10000)};
  }
  if (dataType == DataType.SIX_BYTE_MOD_10K_SWAPPED) {
    long l=value.longValue();
    return new short[]{(short)((l / 100000000L) % 10000),(short)((l / 10000) % 10000),(short)(l % 10000)};
  }
  if (dataType == DataType.SIX_BYTE_MOD_10K) {
    long l=value.longValue();
    return new short[]{(short)(l % 10000),(short)((l / 10000) % 10000),(short)((l / 100000000L) % 10000)};
  }
  if (dataType == DataType.EIGHT_BYTE_MOD_10K_SWAPPED) {
    long l=value.longValue();
    return new short[]{(short)((l / 1000000000000L) % 10000),(short)((l / 100000000L) % 10000),(short)((l / 10000) % 10000),(short)(l % 10000)};
  }
  if (dataType == DataType.EIGHT_BYTE_MOD_10K) {
    long l=value.longValue();
    return new short[]{(short)(l % 10000),(short)((l / 10000) % 10000),(short)((l / 100000000L) % 10000),(short)((l / 1000000000000L) % 10000)};
  }
  if (dataType == DataType.EIGHT_BYTE_INT_UNSIGNED || dataType == DataType.EIGHT_BYTE_INT_SIGNED) {
    long l=value.longValue();
    return new short[]{(short)(l >> 48),(short)(l >> 32),(short)(l >> 16),(short)l};
  }
  if (dataType == DataType.EIGHT_BYTE_INT_UNSIGNED_SWAPPED || dataType == DataType.EIGHT_BYTE_INT_SIGNED_SWAPPED) {
    long l=value.longValue();
    return new short[]{(short)l,(short)(l >> 16),(short)(l >> 32),(short)(l >> 48)};
  }
  if (dataType == DataType.EIGHT_BYTE_FLOAT) {
    long l=Double.doubleToLongBits(value.doubleValue());
    return new short[]{(short)(l >> 48),(short)(l >> 32),(short)(l >> 16),(short)l};
  }
  if (dataType == DataType.EIGHT_BYTE_FLOAT_SWAPPED) {
    long l=Double.doubleToLongBits(value.doubleValue());
    return new short[]{(short)l,(short)(l >> 16),(short)(l >> 32),(short)(l >> 48)};
  }
  throw new RuntimeException("String_Node_Str" + dataType);
}