Program: 68626
Project: 68626
Buggy source:
/** 
 * update output parameter table result
 */
private void updateResults(){
  int outputParamsSize=outputParametersSize();
  if (outputParamsSize == 0)   return;
  DataRequestSession session=null;
  try {
    DataSessionContext context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,((DataSetEditor)getContainer()).getHandle().getModuleHandle());
    session=DataRequestSession.newSession(context);
    QueryDefinition query=new QueryDefinition();
    query.setDataSetName(((DataSetEditor)getContainer()).getHandle().getQualifiedName());
    query.setMaxRows(1);
    PropertyHandle propertyHandle=((DataSetEditor)getContainer()).getHandle().getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
    int paramsSize=propertyHandle.getListValue().size();
    Iterator paramIter=propertyHandle.iterator();
    int outputParamIndex=0;
    TableLayout layout=new TableLayout();
    TableColumn column=null;
    TableItem tableItem=null;
    List paramColumnBindingNames=new ArrayList();
    for (int n=1; n <= paramsSize; n++) {
      DataSetParameterHandle paramDefn=(DataSetParameterHandle)paramIter.next();
      if (!paramDefn.isOutput())       continue;
      column=new TableColumn(outputParameterTable,SWT.LEFT);
      column.setText(paramDefn.getName());
      column.setResizable(true);
      layout.addColumnData(new ColumnPixelData(120,true));
      String bindingName=PREFIX_PARAMETER + (outputParamIndex++);
      IBinding binding=new Binding(bindingName);
      binding.setExpression(new ScriptExpression(PREFIX_OUTPUTPARAMETER + "String_Node_Str" + paramDefn.getName()+ "String_Node_Str"));
      binding.setDataType(DataAdapterUtil.adaptModelDataType(paramDefn.getDataType()));
      paramColumnBindingNames.add(bindingName);
      query.addBinding(binding);
      column.pack();
    }
    outputParameterTable.setLayout(layout);
    outputParameterTable.layout(true);
    IQueryResults actualResultSet=DataSetProvider.getCurrentInstance().execute(((DataSetEditor)getContainer()).getHandle(),query,true,true,session);
    if (actualResultSet != null) {
      IResultIterator iter=actualResultSet.getResultIterator();
      iter.next();
      String[] record=new String[outputParamIndex];
      for (int n=0; n < record.length; n++) {
        record[n]=iter.getString(paramColumnBindingNames.get(n).toString());
      }
      tableItem=new TableItem(outputParameterTable,SWT.NONE);
      tableItem.setText(record);
      actualResultSet.close();
    }
  }
 catch (  Exception ex) {
    ExceptionHandler.handle(ex);
  }
 finally {
    if (session != null) {
      session.shutdown();
    }
  }
}

Fixed version (ground truth):
/** 
 * update output parameter table result
 */
private void updateResults(){
  int outputParamsSize=outputParametersSize();
  if (outputParamsSize == 0)   return;
  DataRequestSession session=null;
  try {
    DataSessionContext context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,((DataSetEditor)getContainer()).getHandle().getModuleHandle());
    session=DataRequestSession.newSession(context);
    QueryDefinition query=new QueryDefinition();
    query.setDataSetName(((DataSetEditor)getContainer()).getHandle().getQualifiedName());
    query.setMaxRows(1);
    PropertyHandle propertyHandle=((DataSetEditor)getContainer()).getHandle().getPropertyHandle(DataSetHandle.PARAMETERS_PROP);
    int paramsSize=propertyHandle.getListValue().size();
    Iterator paramIter=propertyHandle.iterator();
    int outputParamIndex=0;
    TableLayout layout=new TableLayout();
    TableColumn column=null;
    TableItem tableItem=null;
    List paramColumnBindingNames=new ArrayList();
    for (int n=1; n <= paramsSize; n++) {
      DataSetParameterHandle paramDefn=(DataSetParameterHandle)paramIter.next();
      if (!paramDefn.isOutput())       continue;
      column=new TableColumn(outputParameterTable,SWT.LEFT);
      column.setText(paramDefn.getName());
      column.setResizable(true);
      layout.addColumnData(new ColumnPixelData(120,true));
      String bindingName=PREFIX_PARAMETER + (outputParamIndex++);
      IBinding binding=new Binding(bindingName);
      binding.setExpression(new ScriptExpression(PREFIX_OUTPUTPARAMETER + "String_Node_Str" + paramDefn.getName()+ "String_Node_Str"));
      binding.setDataType(DataAdapterUtil.adaptModelDataType(paramDefn.getDataType()));
      paramColumnBindingNames.add(bindingName);
      query.addBinding(binding);
      column.pack();
    }
    outputParameterTable.setLayout(layout);
    outputParameterTable.layout(true);
    DataSetExecutorHelper helper=new DataSetExecutorHelper();
    IQueryResults actualResultSet=helper.execute(((DataSetEditor)getContainer()).getHandle(),query,true,true,session);
    if (actualResultSet != null) {
      IResultIterator iter=actualResultSet.getResultIterator();
      iter.next();
      String[] record=new String[outputParamIndex];
      for (int n=0; n < record.length; n++) {
        record[n]=iter.getString(paramColumnBindingNames.get(n).toString());
      }
      tableItem=new TableItem(outputParameterTable,SWT.NONE);
      tableItem.setText(record);
      actualResultSet.close();
    }
  }
 catch (  Exception ex) {
    ExceptionHandler.handle(ex);
  }
 finally {
    if (session != null) {
      session.shutdown();
    }
  }
}