Program: 72049
Project: 72049
Buggy source:
public Object get(String name,Scriptable start){
  if (ScriptConstants.OUTER_RESULT_KEYWORD.equalsIgnoreCase(name)) {
    if (this.helper.getParent() != null)     return helper.getParent().getScriptable();
 else     return new DataExceptionMocker(new DataException(ResourceConstants.NO_OUTER_RESULTS_EXIST));
  }
  int rowIndex=-1;
  try {
    rowIndex=odiResult.getCurrentResultIndex();
  }
 catch (  BirtException e1) {
  }
  if (ScriptConstants.ROW_NUM_KEYWORD.equalsIgnoreCase(name) || "String_Node_Str".equalsIgnoreCase(name)) {
    return new Integer(rowIndex);
  }
  if (rowIndex == currRowIndex && valueCacheMap.containsKey(name)) {
    return valueCacheMap.get(name);
  }
 else {
    Object value=null;
    try {
      IBinding binding=this.exprManager.getBinding(name);
      if (binding == null) {
        return new DataExceptionMocker(new DataException(ResourceConstants.INVALID_BOUND_COLUMN_NAME,name));
      }
      if (binding.getAggrFunction() != null)       return this.odiResult.getAggrValue(name);
      IBaseExpression dataExpr=this.exprManager.getExpr(name);
      if (dataExpr == null) {
        return new DataExceptionMocker(new DataException(ResourceConstants.INVALID_BOUND_COLUMN_NAME,name));
      }
      value=ExprEvaluateUtil.evaluateValue(dataExpr,this.odiResult.getCurrentResultIndex(),this.odiResult.getCurrentResult(),this.scope);
      value=JavascriptEvalUtil.convertToJavascriptValue(DataTypeUtil.convert(value,binding.getDataType()),this.scope);
    }
 catch (    BirtException e) {
      value=null;
    }
    if (this.currRowIndex != rowIndex) {
      this.valueCacheMap.clear();
      this.currRowIndex=rowIndex;
    }
    valueCacheMap.put(name,value);
    return value;
  }
}

Fixed version (ground truth):
public Object get(String name,Scriptable start){
  if (ScriptConstants.OUTER_RESULT_KEYWORD.equalsIgnoreCase(name)) {
    if (this.helper.getParent() != null)     return helper.getParent().getScriptable();
 else     throw Context.reportRuntimeError(DataResourceHandle.getInstance().getMessage(ResourceConstants.NO_OUTER_RESULTS_EXIST));
  }
  int rowIndex=-1;
  try {
    rowIndex=odiResult.getCurrentResultIndex();
  }
 catch (  BirtException e1) {
  }
  if (ScriptConstants.ROW_NUM_KEYWORD.equalsIgnoreCase(name) || "String_Node_Str".equalsIgnoreCase(name)) {
    return new Integer(rowIndex);
  }
  if (rowIndex == currRowIndex && valueCacheMap.containsKey(name)) {
    return valueCacheMap.get(name);
  }
 else {
    Object value=null;
    try {
      IBinding binding=this.exprManager.getBinding(name);
      if (binding == null) {
        throw Context.reportRuntimeError(DataResourceHandle.getInstance().getMessage(ResourceConstants.INVALID_BOUND_COLUMN_NAME,new String[]{name}));
      }
      if (binding.getAggrFunction() != null)       return this.odiResult.getAggrValue(name);
      IBaseExpression dataExpr=this.exprManager.getExpr(name);
      if (dataExpr == null) {
        throw Context.reportRuntimeError(DataResourceHandle.getInstance().getMessage(ResourceConstants.INVALID_BOUND_COLUMN_NAME,new String[]{name}));
      }
      value=ExprEvaluateUtil.evaluateValue(dataExpr,this.odiResult.getCurrentResultIndex(),this.odiResult.getCurrentResult(),this.scope);
      value=JavascriptEvalUtil.convertToJavascriptValue(DataTypeUtil.convert(value,binding.getDataType()),this.scope);
    }
 catch (    BirtException e) {
      value=null;
    }
    if (this.currRowIndex != rowIndex) {
      this.valueCacheMap.clear();
      this.currRowIndex=rowIndex;
    }
    valueCacheMap.put(name,value);
    return value;
  }
}