Program: 119324
Project: 119324
Buggy source:
/** 
 * DOC nrousseau Comment method "createButtonCommand".
 * @param source
 * @return
 */
protected Command createButtonCommand(Button button){
  String procssId=null;
  if (elem != null && elem instanceof Node) {
    Node runJobNode=(Node)elem;
    procssId=runJobNode.getProcess().getId();
  }
  boolean isSelectUseDynamic=false;
  IElementParameter useDynamicJobParameter=elem.getElementParameter(EParameterName.USE_DYNAMIC_JOB.getName());
  if (useDynamicJobParameter != null && useDynamicJobParameter instanceof IElementParameter) {
    Object useDynamicJobValue=useDynamicJobParameter.getValue();
    if (useDynamicJobValue != null && useDynamicJobValue instanceof Boolean) {
      isSelectUseDynamic=(Boolean)useDynamicJobValue;
    }
  }
  if (isSelectUseDynamic) {
    UseDynamicJobSelectionDialog usedialog=new UseDynamicJobSelectionDialog((button).getShell(),ERepositoryObjectType.PROCESS,procssId,isSelectUseDynamic);
    selectJobNodeIfChecked(button,usedialog);
    if (usedialog.open() == UseDynamicJobSelectionDialog.OK) {
      List<RepositoryNode> repositoryNodeList=usedialog.getRepositoryNodes();
      StringBuffer ids=new StringBuffer();
      String paramName=(String)button.getData(PARAMETER_NAME);
      if (repositoryNodeList != null && repositoryNodeList.size() > 0) {
        for (int i=0; i < repositoryNodeList.size(); i++) {
          RepositoryNode node=repositoryNodeList.get(i);
          IRepositoryViewObject repositoryViewObject=node.getObject();
          final Item item=repositoryViewObject.getProperty().getItem();
          String id=item.getProperty().getId();
          if (i > 0) {
            ids.append(ProcessController.COMMA);
          }
          ids.append(id);
        }
      }
      return new PropertyChangeCommand(elem,paramName,ids.toString());
    }
    return null;
  }
 else {
    List<ERepositoryObjectType> repObjectTypes=new ArrayList<ERepositoryObjectType>();
    repObjectTypes.add(ERepositoryObjectType.PROCESS);
    RepositoryReviewDialog dialog=new RepositoryReviewDialog((button).getShell(),repObjectTypes,procssId);
    selectJobNodeIfExists(button,dialog);
    if (dialog.open() == RepositoryReviewDialog.OK) {
      IRepositoryViewObject repositoryObject=dialog.getResult().getObject();
      final Item item=repositoryObject.getProperty().getItem();
      String id=item.getProperty().getId();
      String paramName=(String)button.getData(PARAMETER_NAME);
      return new PropertyChangeCommand(elem,paramName,id);
    }
    return null;
  }
}

Fixed version (ground truth):
/** 
 * DOC nrousseau Comment method "createButtonCommand".
 * @param source
 * @return
 */
protected Command createButtonCommand(Button button){
  String procssId=null;
  if (elem != null && elem instanceof Node) {
    Node runJobNode=(Node)elem;
    procssId=runJobNode.getProcess().getId();
  }
  boolean isSelectUseDynamic=false;
  IElementParameter useDynamicJobParameter=elem.getElementParameter(EParameterName.USE_DYNAMIC_JOB.getName());
  if (useDynamicJobParameter != null && useDynamicJobParameter instanceof IElementParameter) {
    Object useDynamicJobValue=useDynamicJobParameter.getValue();
    if (useDynamicJobValue != null && useDynamicJobValue instanceof Boolean) {
      isSelectUseDynamic=(Boolean)useDynamicJobValue;
    }
  }
  if (isSelectUseDynamic) {
    UseDynamicJobSelectionDialog usedialog=new UseDynamicJobSelectionDialog((button).getShell(),ERepositoryObjectType.PROCESS,procssId,isSelectUseDynamic);
    selectJobNodeIfChecked(button,usedialog);
    if (usedialog.open() == UseDynamicJobSelectionDialog.OK) {
      List<RepositoryNode> repositoryNodeList=usedialog.getRepositoryNodes();
      StringBuffer ids=new StringBuffer();
      String paramName=(String)button.getData(PARAMETER_NAME);
      if (repositoryNodeList != null && repositoryNodeList.size() > 0) {
        for (int i=0; i < repositoryNodeList.size(); i++) {
          RepositoryNode node=repositoryNodeList.get(i);
          IRepositoryViewObject repositoryViewObject=node.getObject();
          final Item item=repositoryViewObject.getProperty().getItem();
          String id=item.getProperty().getId();
          if (i > 0) {
            ids.append(ProcessController.COMMA);
          }
          ids.append(id);
        }
      }
      return new PropertyChangeCommand(elem,paramName,ids.toString());
    }
    return null;
  }
 else {
    List<ERepositoryObjectType> repObjectTypes=new ArrayList<ERepositoryObjectType>();
    repObjectTypes.add(ERepositoryObjectType.PROCESS);
    repObjectTypes.add(ERepositoryObjectType.PROCESS_MR);
    RepositoryReviewDialog dialog=new RepositoryReviewDialog((button).getShell(),repObjectTypes,procssId);
    selectJobNodeIfExists(button,dialog);
    if (dialog.open() == RepositoryReviewDialog.OK) {
      IRepositoryViewObject repositoryObject=dialog.getResult().getObject();
      final Item item=repositoryObject.getProperty().getItem();
      String id=item.getProperty().getId();
      String paramName=(String)button.getData(PARAMETER_NAME);
      return new PropertyChangeCommand(elem,paramName,id);
    }
    return null;
  }
}