Program: 71731
Project: 71731
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     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,this.cx);
      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,this.cx);
      value=JavascriptEvalUtil.convertToJavascriptValue(DataTypeUtil.convert(value,binding.getDataType()),this.scope);
    }
 catch (    BirtException e) {
      throw Context.reportRuntimeError(e.getLocalizedMessage());
    }
    if (this.currRowIndex != rowIndex) {
      this.valueCacheMap.clear();
      this.currRowIndex=rowIndex;
    }
    valueCacheMap.put(name,value);
    return value;
  }
}