Program: 95814
Project: 95814
Buggy source:
/** 
 * Compares two numerical property values and returns true, if the first one is smaller.
 * @param aValue first value
 * @param bValue second value
 * @return a < b
 */
private static boolean isLessOrEqualThan(PropertyValue aValue,PropertyValue bValue){
  int aType=checkNumericalAndGetType(aValue);
  int bType=checkNumericalAndGetType(bValue);
  boolean sameType=aType == bType;
  int returnType=sameType ? aType : maxType(aType,bType);
  boolean aIsLessOrEqual;
  if (returnType == SHORT) {
    aIsLessOrEqual=aValue.getShort() <= bValue.getShort();
  }
 else   if (returnType == INT) {
    int a;
    int b;
    if (sameType) {
      a=aValue.getInt();
      b=bValue.getInt();
    }
 else {
      a=aType == INT ? aValue.getInt() : aValue.getShort();
      b=aType == INT ? bValue.getInt() : bValue.getShort();
    }
    aIsLessOrEqual=a <= b;
  }
 else   if (returnType == FLOAT) {
    float a;
    float b;
    if (sameType) {
      a=aValue.getFloat();
      b=bValue.getFloat();
    }
 else {
      a=aType == FLOAT ? aValue.getFloat() : aValue.getInt();
      b=bType == FLOAT ? bValue.getFloat() : bValue.getInt();
    }
    aIsLessOrEqual=a <= b;
  }
 else   if (returnType == LONG) {
    long a;
    long b;
    if (sameType) {
      a=aValue.getLong();
      b=bValue.getLong();
    }
 else {
      a=aType == LONG ? aValue.getLong() : aValue.getInt();
      b=bType == LONG ? bValue.getLong() : bValue.getInt();
    }
    aIsLessOrEqual=a <= b;
  }
 else   if (returnType == DOUBLE) {
    double a;
    double b;
    if (sameType) {
      a=aValue.getDouble();
      b=bValue.getDouble();
    }
 else {
      a=aType == DOUBLE ? aValue.getDouble() : doubleValue(aValue,aType);
      b=bType == DOUBLE ? bValue.getDouble() : doubleValue(bValue,bType);
    }
    aIsLessOrEqual=a <= b;
  }
 else {
    BigDecimal a;
    BigDecimal b;
    if (sameType) {
      a=aValue.getBigDecimal();
      b=bValue.getBigDecimal();
    }
 else {
      a=aType == BIG_DECIMAL ? aValue.getBigDecimal() : bigDecimalValue(aValue,aType);
      b=bType == BIG_DECIMAL ? bValue.getBigDecimal() : bigDecimalValue(bValue,bType);
    }
    aIsLessOrEqual=a.compareTo(b) <= 0;
  }
  return aIsLessOrEqual;
}

Fixed version (ground truth):
/** 
 * Compares two numerical property values and returns true, if the first one is smaller.
 * @param aValue first value
 * @param bValue second value
 * @return a < b
 */
private static boolean isLessOrEqualThan(PropertyValue aValue,PropertyValue bValue){
  int aType=checkNumericalAndGetType(aValue);
  int bType=checkNumericalAndGetType(bValue);
  boolean sameType=aType == bType;
  int returnType=maxType(aType,bType);
  boolean aIsLessOrEqual;
  if (returnType == INT) {
    int a=aType == INT ? aValue.getInt() : aValue.getShort();
    int b=bType == INT ? bValue.getInt() : bValue.getShort();
    aIsLessOrEqual=a <= b;
  }
 else   if (returnType == FLOAT) {
    float a;
    float b;
    if (sameType) {
      a=aValue.getFloat();
      b=bValue.getFloat();
    }
 else {
      a=aType == FLOAT ? aValue.getFloat() : floatValue(aValue,aType);
      b=bType == FLOAT ? bValue.getFloat() : floatValue(bValue,bType);
    }
    aIsLessOrEqual=a <= b;
  }
 else   if (returnType == LONG) {
    long a;
    long b;
    if (sameType) {
      a=aValue.getLong();
      b=bValue.getLong();
    }
 else {
      a=aType == LONG ? aValue.getLong() : longValue(aValue,aType);
      b=bType == LONG ? bValue.getLong() : longValue(bValue,bType);
    }
    aIsLessOrEqual=a <= b;
  }
 else   if (returnType == DOUBLE) {
    double a;
    double b;
    if (sameType) {
      a=aValue.getDouble();
      b=bValue.getDouble();
    }
 else {
      a=aType == DOUBLE ? aValue.getDouble() : doubleValue(aValue,aType);
      b=bType == DOUBLE ? bValue.getDouble() : doubleValue(bValue,bType);
    }
    aIsLessOrEqual=a <= b;
  }
 else {
    BigDecimal a;
    BigDecimal b;
    if (sameType) {
      a=aValue.getBigDecimal();
      b=bValue.getBigDecimal();
    }
 else {
      a=aType == BIG_DECIMAL ? aValue.getBigDecimal() : bigDecimalValue(aValue,aType);
      b=bType == BIG_DECIMAL ? bValue.getBigDecimal() : bigDecimalValue(bValue,bType);
    }
    aIsLessOrEqual=a.compareTo(b) <= 0;
  }
  return aIsLessOrEqual;
}