Program: 69883
Project: 69883
Buggy source:
private void refreshValues(){
  resultList.clear();
  if (columnChooser.isEnabled()) {
    ResultSetColumnHandle selectedColumn=null;
    try {
      IQueryDefinition query=DataUtil.getPreparedQuery(engine,getDataSetHandle()).getReportQueryDefn();
      String queryExpr=null;
      for (Iterator iter=columnList.iterator(); iter.hasNext(); ) {
        ResultSetColumnHandle column=(ResultSetColumnHandle)iter.next();
        if (column.getColumnName().equals(columnChooser.getText())) {
          queryExpr=DEUtil.getResultSetColumnExpression(column.getColumnName());
          selectedColumn=column;
          break;
        }
      }
      if (queryExpr == null) {
        return;
      }
      ScriptExpression expression=new ScriptExpression(queryExpr);
      String columnBindingName="String_Node_Str";
      Binding binding=new Binding(columnBindingName);
      binding.setExpression(expression);
      if (expression != null)       binding.setDataType(expression.getDataType());
      query.addBinding(binding);
      DataSessionContext context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,getDataSetHandle().getModuleHandle());
      DataRequestSession session=DataRequestSession.newSession(context);
      IQueryResults results=DataSetProvider.getCurrentInstance().execute(getDataSetHandle(),query,true,true,true,session);
      if (results != null) {
        IResultIterator iter=results.getResultIterator();
        if (iter != null) {
          while (iter.next()) {
            String result=null;
            Object data=iter.getValue(columnBindingName);
            if (data instanceof Date) {
              result=convertToStandardFormat((Date)data);
            }
 else {
              if (data == null) {
                result=nullValue;
                hasNullValue=true;
              }
 else {
                result=String.valueOf(data);
              }
            }
            if (!resultList.contains(result)) {
              resultList.add(result);
            }
          }
        }
        results.close();
        session.shutdown();
      }
    }
 catch (    Exception e) {
      ExceptionHandler.handle(e);
      valueList.removeAll();
      valueList.deselectAll();
      updateButtons();
    }
    filteValues();
  }
 else {
    valueList.removeAll();
    valueList.deselectAll();
    updateButtons();
  }
}

Fixed version (ground truth):
private void refreshValues(){
  resultList.clear();
  if (columnChooser.isEnabled()) {
    ResultSetColumnHandle selectedColumn=null;
    try {
      IQueryDefinition query=DataUtil.getPreparedQuery(engine,getDataSetHandle()).getReportQueryDefn();
      String queryExpr=null;
      int queryValueType=-1;
      for (Iterator iter=columnList.iterator(); iter.hasNext(); ) {
        ResultSetColumnHandle column=(ResultSetColumnHandle)iter.next();
        if (column.getColumnName().equals(columnChooser.getText())) {
          queryExpr=DEUtil.getResultSetColumnExpression(column.getColumnName());
          queryValueType=DataAdapterUtil.adaptModelDataType(column.getDataType());
          selectedColumn=column;
          break;
        }
      }
      if (queryExpr == null) {
        return;
      }
      ScriptExpression expression=new ScriptExpression(queryExpr);
      String columnBindingName="String_Node_Str";
      Binding binding=new Binding(columnBindingName);
      binding.setExpression(expression);
      binding.setDataType(queryValueType);
      query.addBinding(binding);
      DataSessionContext context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,getDataSetHandle().getModuleHandle());
      DataRequestSession session=DataRequestSession.newSession(context);
      IQueryResults results=DataSetProvider.getCurrentInstance().execute(getDataSetHandle(),query,true,true,true,session);
      if (results != null) {
        IResultIterator iter=results.getResultIterator();
        if (iter != null) {
          while (iter.next()) {
            String result=null;
            Object data=iter.getValue(columnBindingName);
            if (data instanceof Date) {
              result=convertToStandardFormat((Date)data);
            }
 else {
              if (data == null) {
                result=nullValue;
                hasNullValue=true;
              }
 else {
                result=String.valueOf(data);
              }
            }
            if (!resultList.contains(result)) {
              resultList.add(result);
            }
          }
        }
        results.close();
        session.shutdown();
      }
    }
 catch (    Exception e) {
      ExceptionHandler.handle(e);
      valueList.removeAll();
      valueList.deselectAll();
      updateButtons();
    }
    filteValues();
  }
 else {
    valueList.removeAll();
    valueList.deselectAll();
    updateButtons();
  }
}