Program: 69181
Project: 69181
Buggy source:
/** 
 * Refreshes the parameter list adds any new parameter retrieved. This method doesn't clear unused parameters. It is the users responsibility to delete individual parameters through the UI.
 */
private void refreshParameters(){
  try {
    DataSetHandle ds=((DataSetHandle)getContainer().getModel());
    Collection paramsFromDataSet=null;
    paramsFromDataSet=DataSetProvider.getCurrentInstance().getParametersFromDataSet(ds);
    if (paramsFromDataSet != null) {
      Iterator iter=paramsFromDataSet.iterator();
      while (iter.hasNext()) {
        IParameterMetaData paramFromDataSet=(IParameterMetaData)iter.next();
        DataSetParameter parameter=null;
        if (paramFromDataSet.getPosition() > 0) {
          parameter=findParameterByPosition(paramFromDataSet.getPosition());
        }
 else {
          parameter=findParameterByName(paramFromDataSet.getName());
        }
        if (parameter != null) {
          DataSetParameter newParameter=newParameter(paramFromDataSet);
          if (!isSameParameters(parameter,newParameter)) {
            parameters.replaceItem(parameter,newParameter);
          }
        }
 else {
          parameters.addItem(newParameter(paramFromDataSet));
        }
      }
      if (parameters.getListValue() != null && paramsFromDataSet.size() < parameters.getListValue().size()) {
        int size=parameters.getListValue().size();
        while (size > paramsFromDataSet.size()) {
          parameters.removeItem(size - 1);
          size=parameters.getListValue().size();
        }
      }
      updateParams2UniqueName(parameters.getListValue());
    }
 else {
      if (viewer != null) {
        PropertyHandle handle=(PropertyHandle)viewer.getViewer().getInput();
        handle.clearValue();
      }
    }
    refreshPositions();
    setPageProperties();
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
/** 
 * Refreshes the parameter list adds any new parameter retrieved. This method doesn't clear unused parameters. It is the users responsibility to delete individual parameters through the UI.
 */
private void refreshParameters(){
  try {
    DataSetHandle ds=((DataSetHandle)getContainer().getModel());
    Collection paramsFromDataSet=null;
    paramsFromDataSet=DataSetProvider.getCurrentInstance().getParametersFromDataSet(ds);
    if (paramsFromDataSet != null) {
      Iterator iter=paramsFromDataSet.iterator();
      while (iter.hasNext()) {
        IParameterMetaData paramFromDataSet=(IParameterMetaData)iter.next();
        DataSetParameter parameter=null;
        if (paramFromDataSet.getPosition() > 0) {
          parameter=findParameterByPosition(paramFromDataSet.getPosition());
        }
 else {
          parameter=findParameterByName(paramFromDataSet.getName());
        }
        if (parameter != null) {
          DataSetParameter newParameter=newParameter(paramFromDataSet);
          if (!isSameParameters(parameter,newParameter)) {
            parameters.replaceItem(parameter,newParameter);
          }
        }
 else {
          parameters.addItem(newParameter(paramFromDataSet));
        }
      }
      if (parameters.getListValue() != null && paramsFromDataSet.size() < parameters.getListValue().size()) {
        int size=parameters.getListValue().size();
        while (size > paramsFromDataSet.size()) {
          parameters.removeItem(size - 1);
          size=parameters.getListValue().size();
        }
      }
      updateParams2UniqueName(parameters.getListValue());
    }
 else {
      if (viewer != null) {
        PropertyHandle handle=(PropertyHandle)viewer.getViewer().getInput();
        handle.clearValue();
      }
    }
    refreshPositions();
    setPageProperties();
    refreshMessage();
  }
 catch (  Exception e) {
  }
}