Program: 74852
Project: 74852
Buggy source:
/** 
 * @param obj
 * @param operator
 * @param op1
 * @param op2
 * @return A Boolean result
 * @throws DataException
 */
public static Object evalConditionalExpr(Object obj,int operator,Object[] ops) throws DataException {
  ExprTextAndValue[] opTextAndValue=new ExprTextAndValue[ops.length];
  for (int i=0; i < ops.length; i++) {
    opTextAndValue[i]=createExprTextAndValueInstance(ops[i]);
  }
  Object resultObject=obj;
  Object[] resultOp=new Object[ops.length];
  for (int i=0; i < ops.length; i++) {
    resultOp[i]=opTextAndValue[i].value;
  }
  Object[] obArray=MiscUtil.isComparable(obj,operator,opTextAndValue);
  if (obArray != null) {
    resultObject=obArray[0];
    for (int i=1; i < obArray.length; i++) {
      resultOp[i - 1]=obArray[i];
    }
  }
  if (logger.isLoggable(Level.FINER)) {
    String logStr="String_Node_Str";
    for (int i=0; i < ops.length; i++) {
      logStr+=resultOp[i] == null ? null : ("String_Node_Str" + i + "String_Node_Str"+ LogUtil.toString(resultOp[i]));
    }
    logger.entering(ScriptEvalUtil.class.getName(),"String_Node_Str","String_Node_Str" + LogUtil.toString(resultObject) + "String_Node_Str"+ operator+ logStr);
  }
  boolean result=false;
switch (operator) {
case IConditionalExpression.OP_EQ:
    result=compare(resultObject,resultOp[0]) == 0;
  break;
case IConditionalExpression.OP_NE:
result=compare(resultObject,resultOp[0]) != 0;
break;
case IConditionalExpression.OP_LT:
result=compare(resultObject,resultOp[0]) < 0;
break;
case IConditionalExpression.OP_LE:
result=compare(resultObject,resultOp[0]) <= 0;
break;
case IConditionalExpression.OP_GE:
result=compare(resultObject,resultOp[0]) >= 0;
break;
case IConditionalExpression.OP_GT:
result=compare(resultObject,resultOp[0]) > 0;
break;
case IConditionalExpression.OP_BETWEEN:
result=between(resultObject,resultOp[0],resultOp[1]);
break;
case IConditionalExpression.OP_NOT_BETWEEN:
result=!(between(resultObject,resultOp[0],resultOp[1]));
break;
case IConditionalExpression.OP_NULL:
result=resultObject == null;
break;
case IConditionalExpression.OP_NOT_NULL:
result=resultObject != null;
break;
case IConditionalExpression.OP_TRUE:
result=isTrueOrFalse(resultObject,Boolean.TRUE);
break;
case IConditionalExpression.OP_FALSE:
result=isTrueOrFalse(resultObject,Boolean.FALSE);
break;
case IConditionalExpression.OP_LIKE:
result=like(resultObject,resultOp[0]);
break;
case IConditionalExpression.OP_NOT_LIKE:
result=!like(resultObject,resultOp[0]);
break;
case IConditionalExpression.OP_TOP_N:
case IConditionalExpression.OP_BOTTOM_N:
case IConditionalExpression.OP_TOP_PERCENT:
case IConditionalExpression.OP_BOTTOM_PERCENT:
throw new DataException(ResourceConstants.UNSUPPORTTED_COND_OPERATOR,"String_Node_Str");
case IConditionalExpression.OP_MATCH:
result=match(resultObject,resultOp[0]);
break;
case IConditionalExpression.OP_NOT_MATCH:
result=!match(resultObject,resultOp[0]);
break;
case IConditionalExpression.OP_IN:
result=in(obArray);
break;
case IConditionalExpression.OP_NOT_IN:
result=!in(obArray);
break;
default :
throw new DataException(ResourceConstants.UNSUPPORTTED_COND_OPERATOR,new Integer(operator));
}
logger.exiting(ScriptEvalUtil.class.getName(),"String_Node_Str",new Boolean(result));
return new Boolean(result);
}

Fixed version (ground truth):
/** 
 * @param obj
 * @param operator
 * @param op1
 * @param op2
 * @return A Boolean result
 * @throws DataException
 */
public static Object evalConditionalExpr(Object obj,int operator,Object[] ops) throws DataException {
  ExprTextAndValue[] opTextAndValue=new ExprTextAndValue[ops.length];
  for (int i=0; i < ops.length; i++) {
    opTextAndValue[i]=createExprTextAndValueInstance(ops[i]);
  }
  Object resultObject=obj;
  Object[] resultOp=new Object[ops.length];
  for (int i=0; i < ops.length; i++) {
    resultOp[i]=opTextAndValue[i].value;
  }
  Object[] obArray=MiscUtil.isComparable(obj,operator,opTextAndValue);
  if (obArray != null) {
    resultObject=obArray[0];
    for (int i=1; i < obArray.length; i++) {
      resultOp[i - 1]=obArray[i];
    }
  }
  if (logger.isLoggable(Level.FINER)) {
    String logStr="String_Node_Str";
    for (int i=0; i < ops.length; i++) {
      logStr+=resultOp[i] == null ? null : ("String_Node_Str" + i + "String_Node_Str"+ LogUtil.toString(resultOp[i]));
    }
    logger.entering(ScriptEvalUtil.class.getName(),"String_Node_Str","String_Node_Str" + LogUtil.toString(resultObject) + "String_Node_Str"+ operator+ logStr);
  }
  boolean result=false;
switch (operator) {
case IConditionalExpression.OP_EQ:
    result=compare(resultObject,resultOp[0]) == 0;
  break;
case IConditionalExpression.OP_NE:
result=compare(resultObject,resultOp[0]) != 0;
break;
case IConditionalExpression.OP_LT:
result=compare(resultObject,resultOp[0]) < 0;
break;
case IConditionalExpression.OP_LE:
result=compare(resultObject,resultOp[0]) <= 0;
break;
case IConditionalExpression.OP_GE:
result=compare(resultObject,resultOp[0]) >= 0;
break;
case IConditionalExpression.OP_GT:
result=compare(resultObject,resultOp[0]) > 0;
break;
case IConditionalExpression.OP_BETWEEN:
result=between(resultObject,resultOp[0],resultOp[1]);
break;
case IConditionalExpression.OP_NOT_BETWEEN:
result=!(between(resultObject,resultOp[0],resultOp[1]));
break;
case IConditionalExpression.OP_NULL:
result=resultObject == null;
break;
case IConditionalExpression.OP_NOT_NULL:
result=resultObject != null;
break;
case IConditionalExpression.OP_TRUE:
result=isTrueOrFalse(resultObject,Boolean.TRUE);
break;
case IConditionalExpression.OP_FALSE:
result=isTrueOrFalse(resultObject,Boolean.FALSE);
break;
case IConditionalExpression.OP_LIKE:
result=like(resultObject,resultOp[0]);
break;
case IConditionalExpression.OP_NOT_LIKE:
result=!like(resultObject,resultOp[0]);
break;
case IConditionalExpression.OP_TOP_N:
case IConditionalExpression.OP_BOTTOM_N:
case IConditionalExpression.OP_TOP_PERCENT:
case IConditionalExpression.OP_BOTTOM_PERCENT:
throw new DataException(ResourceConstants.UNSUPPORTTED_COND_OPERATOR,"String_Node_Str");
case IConditionalExpression.OP_MATCH:
result=match(resultObject,resultOp[0]);
break;
case IConditionalExpression.OP_NOT_MATCH:
result=!match(resultObject,resultOp[0]);
break;
case IConditionalExpression.OP_IN:
result=in(resultObject,resultOp);
break;
case IConditionalExpression.OP_NOT_IN:
result=!in(resultObject,resultOp);
break;
default :
throw new DataException(ResourceConstants.UNSUPPORTTED_COND_OPERATOR,new Integer(operator));
}
logger.exiting(ScriptEvalUtil.class.getName(),"String_Node_Str",new Boolean(result));
return new Boolean(result);
}