Program: 74201
Project: 74201
Buggy source:
protected CompiledExpression compileDirectColRefExpr(Node parent,Node refNode,Node grandfather,boolean customerChecked,Context context) throws DataException {
  if ((refNode.getType() == Token.GETPROP || refNode.getType() == Token.GETELEM) && (!this.getDataSetMode())) {
    String columnBindingName;
    if (refNode.getFirstChild().getType() == Token.NAME && refNode.getLastChild().getType() == Token.STRING && refNode.getFirstChild().getString().equals(this.ROW_INDICATOR)) {
{
        columnBindingName=refNode.getLastChild().getString();
        if (columnBindingName != null && !columnBindingName.equals("String_Node_Str") && !columnBindingName.equals("String_Node_Str") && !columnBindingName.equals("String_Node_Str")) {
          IBinding binding=this.rsPopulator.getEventHandler().getBinding(columnBindingName);
          if (binding == null)           throw new DataException(ResourceConstants.BAD_DATA_EXPRESSION);
          if (binding.getAggrFunction() == null) {
            IScriptExpression expression=(IScriptExpression)binding.getExpression();
            currentGroupLevelList.add(expression.getGroupName());
            ScriptOrFnNode tree=parse(expression.getText(),context);
            CompiledExpression expr=null;
            if (grandfather != null) {
              if (tree.getFirstChild() == tree.getLastChild()) {
                grandfather.replaceChild(parent,tree.getFirstChild());
                expr=processChild(context,false,tree.getFirstChild(),tree.getFirstChild().getFirstChild(),grandfather);
              }
 else {
                grandfather.replaceChild(grandfather.getFirstChild(),tree.getFirstChild());
                grandfather.replaceChild(grandfather.getLastChild(),tree.getLastChild());
                expr=this.compileComplexExpr(context,tree,false);
              }
            }
 else {
              if (tree.getFirstChild() == tree.getLastChild()) {
                parent.replaceChild(refNode,tree.getFirstChild().getFirstChild());
                expr=processChild(context,false,parent,tree.getFirstChild().getFirstChild(),grandfather);
              }
 else {
                expr=this.compileComplexExpr(context,tree,false);
              }
            }
            currentGroupLevelList.remove(currentGroupLevelList.size() - 1);
            if (expr != null) {
              if ((expr instanceof ColumnReferenceExpression)) {
                ((ColumnReferenceExpression)expr).setDataType(expression.getDataType());
                return expr;
              }
              return expr;
            }
          }
        }
      }
    }
  }
  ColumnReferenceExpression expr=super.compileColRefExpr(refNode,customerChecked);
  if (customerChecked && expr != null) {
    if (expr.getColumnName() != null && expr.getColumnName().trim().length() > 0)     checkAvailableCmpColumn(expr.getColumnName());
  }
  return expr;
}

Fixed version (ground truth):
protected CompiledExpression compileDirectColRefExpr(Node parent,Node refNode,Node grandfather,boolean customerChecked,Context context) throws DataException {
  if ((refNode.getType() == Token.GETPROP || refNode.getType() == Token.GETELEM) && (!this.getDataSetMode())) {
    String columnBindingName;
    if (refNode.getFirstChild().getType() == Token.NAME && refNode.getLastChild().getType() == Token.STRING && refNode.getFirstChild().getString().equals(this.ROW_INDICATOR)) {
{
        columnBindingName=refNode.getLastChild().getString();
        if (columnBindingName != null && !columnBindingName.equals("String_Node_Str") && !columnBindingName.equals("String_Node_Str") && !columnBindingName.equals("String_Node_Str")) {
          IBinding binding=this.rsPopulator.getEventHandler().getBinding(columnBindingName);
          if (binding == null)           throw new DataException(ResourceConstants.BAD_DATA_EXPRESSION);
          if (binding.getAggrFunction() == null) {
            IScriptExpression expression=(IScriptExpression)binding.getExpression();
            currentGroupLevelList.add(expression.getGroupName());
            ScriptOrFnNode tree=parse(expression.getText(),context);
            if (tree.getFirstChild() != null && tree.getFirstChild().getFirstChild() != null && tree.getFirstChild().getFirstChild().getType() != Token.IFNE && tree.getFirstChild().getFirstChild().getType() != Token.IFEQ) {
              CompiledExpression expr=null;
              if (grandfather != null) {
                if (tree.getFirstChild() == tree.getLastChild()) {
                  grandfather.replaceChild(parent,tree.getFirstChild());
                  expr=processChild(context,false,tree.getFirstChild(),tree.getFirstChild().getFirstChild(),grandfather);
                }
 else {
                  grandfather.replaceChild(grandfather.getFirstChild(),tree.getFirstChild());
                  grandfather.replaceChild(grandfather.getLastChild(),tree.getLastChild());
                  expr=this.compileComplexExpr(context,tree,false);
                }
              }
 else {
                if (tree.getFirstChild() == tree.getLastChild()) {
                  parent.replaceChild(refNode,tree.getFirstChild().getFirstChild());
                  expr=processChild(context,false,parent,tree.getFirstChild().getFirstChild(),grandfather);
                }
 else {
                  expr=this.compileComplexExpr(context,tree,false);
                }
              }
              currentGroupLevelList.remove(currentGroupLevelList.size() - 1);
              if (expr != null) {
                if ((expr instanceof ColumnReferenceExpression)) {
                  ((ColumnReferenceExpression)expr).setDataType(expression.getDataType());
                  return expr;
                }
                return expr;
              }
            }
          }
        }
      }
    }
  }
  ColumnReferenceExpression expr=super.compileColRefExpr(refNode,customerChecked);
  if (customerChecked && expr != null) {
    if (expr.getColumnName() != null && expr.getColumnName().trim().length() > 0)     checkAvailableCmpColumn(expr.getColumnName());
  }
  return expr;
}