Program: 79027
Project: 79027
Buggy source:
/** 
 * Evaluates a IJSExpression or IConditionalExpression
 */
public static Object evalExpr(IBaseExpression expr,Context cx,Scriptable scope,String source,int lineNo) throws DataException {
  if (logger.isLoggable(Level.FINER))   logger.entering(ScriptEvalUtil.class.getName(),"String_Node_Str","String_Node_Str" + LogUtil.toString(expr) + "String_Node_Str"+ source+ "String_Node_Str"+ lineNo);
  if (expr == null) {
    if (logger.isLoggable(Level.FINER))     logger.exiting(ScriptEvalUtil.class.getName(),"String_Node_Str",null);
    return null;
  }
 else   if (expr instanceof IConditionalExpression) {
    ConditionalExpression ConditionalExpr=(ConditionalExpression)expr;
    Object expression=evalExpr(ConditionalExpr.getExpression(),cx,scope,source,lineNo);
    Object Op1=evalExpr(constructValidScriptExpression(ConditionalExpr.getOperand1()),cx,scope,source,lineNo);
    Object Op2=evalExpr(constructValidScriptExpression(ConditionalExpr.getOperand2()),cx,scope,source,lineNo);
    if (logger.isLoggable(Level.FINER))     logger.exiting(ScriptEvalUtil.class.getName(),"String_Node_Str",evalConditionalExpr(expression,ConditionalExpr.getOperator(),Op1,Op2));
    return evalConditionalExpr(expression,ConditionalExpr.getOperator(),Op1,Op2);
  }
 else {
    IScriptExpression jsExpr=(IScriptExpression)expr;
    if (logger.isLoggable(Level.FINER))     logger.exiting(ScriptEvalUtil.class.getName(),"String_Node_Str",evaluateJSAsExpr(cx,scope,jsExpr.getText(),source,lineNo));
    if (jsExpr.getText() != null && jsExpr.getHandle() != null)     return ((CompiledExpression)jsExpr.getHandle()).evaluate(cx,scope);
    return evaluateJSAsExpr(cx,scope,jsExpr.getText(),source,lineNo);
  }
}

Fixed version (ground truth):
/** 
 * Evaluates a IJSExpression or IConditionalExpression
 */
public static Object evalExpr(IBaseExpression expr,Context cx,Scriptable scope,String source,int lineNo) throws DataException {
  if (logger.isLoggable(Level.FINER))   logger.entering(ScriptEvalUtil.class.getName(),"String_Node_Str","String_Node_Str" + LogUtil.toString(expr) + "String_Node_Str"+ source+ "String_Node_Str"+ lineNo);
  if (expr == null) {
    if (logger.isLoggable(Level.FINER))     logger.exiting(ScriptEvalUtil.class.getName(),"String_Node_Str",null);
    return null;
  }
 else   if (expr instanceof IConditionalExpression) {
    ConditionalExpression ConditionalExpr=(ConditionalExpression)expr;
    Object expression=evalExpr(ConditionalExpr.getExpression(),cx,scope,source,lineNo);
    Object Op1=evalExpr(constructValidScriptExpression(ConditionalExpr.getOperand1()),cx,scope,source,lineNo);
    Object Op2=evalExpr(constructValidScriptExpression(ConditionalExpr.getOperand2()),cx,scope,source,lineNo);
    if (logger.isLoggable(Level.FINER))     logger.exiting(ScriptEvalUtil.class.getName(),"String_Node_Str",evalConditionalExpr(expression,ConditionalExpr.getOperator(),Op1,Op2));
    return evalConditionalExpr(expression,ConditionalExpr.getOperator(),Op1,Op2);
  }
 else {
    IScriptExpression jsExpr=(IScriptExpression)expr;
    if (logger.isLoggable(Level.FINER))     logger.exiting(ScriptEvalUtil.class.getName(),"String_Node_Str",evaluateJSAsExpr(cx,scope,jsExpr.getText(),source,lineNo));
    if (jsExpr.getText() != null && jsExpr.getHandle() != null)     return convertNativeObjToJavaObj(((CompiledExpression)jsExpr.getHandle()).evaluate(cx,scope));
    return evaluateJSAsExpr(cx,scope,jsExpr.getText(),source,lineNo);
  }
}