nus-yam/ex-repair huggingface dataset:
Program: 95842
Project: 95842
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void createPartControlImpl(Composite parent){
  super.createPartControlImpl(parent);
  m_eventHandlerTreeViewer.setContentProvider(new EventHandlerContentProvider());
  m_eventHandlerTreeViewer.getControl().setMenu(createContextMenu());
  addDoubleClickListener(CommandIDs.OPEN_SPECIFICATION_COMMAND_ID,m_eventHandlerTreeViewer);
  ActionListener actionListener=new ActionListener();
  getTreeViewer().addSelectionChangedListener(actionListener);
  getEventHandlerTreeViewer().addSelectionChangedListener(actionListener);
  if (!Plugin.getDefault().anyDirtyStar()) {
    checkAndRemoveUnusedTestData();
  }
  m_currentTreeViewer=getMainTreeViewer();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void createPartControlImpl(Composite parent){
  super.createPartControlImpl(parent);
  m_eventHandlerTreeViewer.setContentProvider(new EventHandlerContentProvider());
  m_eventHandlerTreeViewer.getControl().setMenu(createContextMenu());
  addDoubleClickListener(CommandIDs.OPEN_SPECIFICATION_COMMAND_ID,m_eventHandlerTreeViewer);
  ActionListener actionListener=new ActionListener();
  getTreeViewer().addSelectionChangedListener(actionListener);
  getEventHandlerTreeViewer().addSelectionChangedListener(actionListener);
  if (!Plugin.getDefault().anyDirtyStar()) {
    checkAndRemoveUnusedTestData();
  }
  m_currentTreeViewer=getMainTreeViewer();
  m_selectionProviderDelegate=new SelectionProviderIntermediate();
  m_selectionProviderDelegate.setSelectionProviderDelegate(m_currentTreeViewer);
  getSite().setSelectionProvider(m_selectionProviderDelegate);
}
Program: 95843
Project: 95843
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void focusGained(FocusEvent e){
  Tree tree=(Tree)e.getSource();
  if (getMainTreeViewer().getTree() == tree) {
    m_currentTreeViewer=getMainTreeViewer();
  }
 else   if (getEventHandlerTreeViewer().getTree() == tree) {
    m_currentTreeViewer=getEventHandlerTreeViewer();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void focusGained(FocusEvent e){
  Tree tree=(Tree)e.getSource();
  if (getMainTreeViewer().getTree() == tree) {
    m_currentTreeViewer=getMainTreeViewer();
  }
 else   if (getEventHandlerTreeViewer().getTree() == tree) {
    m_currentTreeViewer=getEventHandlerTreeViewer();
  }
  m_selectionProviderDelegate.setSelectionProviderDelegate(m_currentTreeViewer);
}
Program: 95844
Project: 95844
Buggy source:
/** 
 * {@inheritDoc}
 */
public void createPartControl(Composite parent){
  buildTree(parent);
  Plugin.getHelpSystem().setHelp(m_treeViewer.getControl(),ContextHelpIds.JB_PROPERTIES_VIEW);
  final DataEventDispatcher dispatcher=DataEventDispatcher.getInstance();
  dispatcher.addDataChangedListener(this,true);
  dispatcher.addParamChangedListener(this,true);
  dispatcher.addPartClosedListener(this,true);
  dispatcher.addLanguageChangedListener(this,true);
  m_treeViewer.getControl().addHelpListener(m_helpListener);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void createPartControl(Composite parent){
  buildTree(parent);
  Plugin.getHelpSystem().setHelp(m_treeViewer.getControl(),ContextHelpIds.JB_PROPERTIES_VIEW);
  final DataEventDispatcher dispatcher=DataEventDispatcher.getInstance();
  dispatcher.addDataChangedListener(this,true);
  dispatcher.addParamChangedListener(this,true);
  dispatcher.addPartClosedListener(this,true);
  dispatcher.addLanguageChangedListener(this,true);
  m_treeViewer.getControl().addHelpListener(m_helpListener);
  getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(this);
}
Program: 95845
Project: 95845
Buggy source:
/** 
 * {@inheritDoc}
 */
public void createPartControl(Composite parent){
  m_cutTreeItemAction=new CutTreeItemActionTCBrowser();
  m_pasteTreeItemAction=new PasteTreeItemActionTCBrowser();
  super.createPartControl(parent);
  getViewSite().getActionBars().getToolBarManager().add(CommandHelper.createContributionItem(RCPCommandIDs.SET_MAIN_VIEW_INSTANCE,null,null,CommandContributionItem.STYLE_PUSH));
  getViewSite().getActionBars().getToolBarManager().add(CommandHelper.createContributionItem(RCPCommandIDs.COLLAPSE_ALL,null,null,CommandContributionItem.STYLE_PUSH));
  ColumnViewerToolTipSupport.enableFor(getTreeViewer());
  getTreeViewer().setContentProvider(new TestCaseBrowserContentProvider());
  DecoratingCellLabelProvider lp=new DecoratingCellLabelProvider(new TestCaseBrowserLabelProvider(),Plugin.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator());
  getTreeViewer().setLabelProvider(lp);
  int ops=DND.DROP_MOVE;
  Transfer[] transfers=new Transfer[]{LocalSelectionTransfer.getInstance()};
  getTreeViewer().addDragSupport(ops,transfers,new TreeViewerContainerDragSourceListener(getTreeViewer()));
  getTreeViewer().addDropSupport(ops,transfers,new TestSpecDropTargetListener(this));
  registerContextMenu();
  Plugin.getHelpSystem().setHelp(getTreeViewer().getControl(),ContextHelpIds.TEST_SPEC_VIEW);
  configureActionBars();
  if (GeneralStorage.getInstance().getProject() != null) {
    handleProjectLoaded();
  }
  MultipleTCBTracker.getInstance().addTCB(this);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void createPartControl(Composite parent){
  m_cutTreeItemAction=new CutTreeItemActionTCBrowser();
  m_pasteTreeItemAction=new PasteTreeItemActionTCBrowser();
  super.createPartControl(parent);
  getViewSite().getActionBars().getToolBarManager().add(CommandHelper.createContributionItem(RCPCommandIDs.SET_MAIN_VIEW_INSTANCE,null,null,CommandContributionItem.STYLE_PUSH));
  getViewSite().getActionBars().getToolBarManager().add(CommandHelper.createContributionItem(RCPCommandIDs.COLLAPSE_ALL,null,null,CommandContributionItem.STYLE_PUSH));
  ColumnViewerToolTipSupport.enableFor(getTreeViewer());
  getTreeViewer().setContentProvider(new TestCaseBrowserContentProvider());
  DecoratingCellLabelProvider lp=new DecoratingCellLabelProvider(new TestCaseBrowserLabelProvider(),Plugin.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator());
  getTreeViewer().setLabelProvider(lp);
  int ops=DND.DROP_MOVE;
  Transfer[] transfers=new Transfer[]{LocalSelectionTransfer.getInstance()};
  getTreeViewer().addDragSupport(ops,transfers,new TreeViewerContainerDragSourceListener(getTreeViewer()));
  getTreeViewer().addDropSupport(ops,transfers,new TestSpecDropTargetListener(this));
  registerContextMenu();
  Plugin.getHelpSystem().setHelp(getTreeViewer().getControl(),ContextHelpIds.TEST_SPEC_VIEW);
  configureActionBars();
  if (GeneralStorage.getInstance().getProject() != null) {
    handleProjectLoaded();
  }
  MultipleTCBTracker.getInstance().addTCB(this);
  getSite().setSelectionProvider(getTreeViewer());
}
Program: 95847
Project: 95847
Buggy source:
/** 
 * Fix for MS Windows for keys that also appear on the numpad. Turns NumLock off if it is on. First method called of a two-part fix.
 * @param keyCode keycode to check
 * @return <code>True</code>, if the NumLock status was toggled. Otherwise<code>false</code>. Basically, a value of true indicates that  second part of this fix must also be used.
 */
private boolean hackWindowsNumpadKeys1(int keyCode){
  boolean isNumpadKey=false;
  for (int i=0; i < NUMPAD_KEYCODES.length; ++i) {
    if (NUMPAD_KEYCODES[i] == keyCode) {
      isNumpadKey=true;
      break;
    }
  }
  boolean wasNumLockToggled=false;
  if (isNumpadKey) {
    try {
      m_robot.keyPress(KeyEvent.VK_NUM_LOCK);
      m_robot.keyRelease(KeyEvent.VK_NUM_LOCK);
      m_robot.keyPress(KeyEvent.VK_NUM_LOCK);
      m_robot.keyRelease(KeyEvent.VK_NUM_LOCK);
      if (Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_NUM_LOCK)) {
        Toolkit.getDefaultToolkit().setLockingKeyState(KeyEvent.VK_NUM_LOCK,false);
        wasNumLockToggled=true;
      }
    }
 catch (    UnsupportedOperationException usoe) {
      log.info("String_Node_Str" + "String_Node_Str");
    }
  }
  return wasNumLockToggled;
}

Fixed version (ground truth):
/** 
 * Fix for MS Windows for keys that also appear on the numpad. Turns NumLock off if it is on. First method called of a two-part fix.
 * @param keyCode keycode to check
 * @return <code>True</code>, if the NumLock status was toggled. Otherwise<code>false</code>. Basically, a value of true indicates that  second part of this fix must also be used.
 */
private boolean hackWindowsNumpadKeys1(int keyCode){
  if (!EnvironmentUtils.isWindowsOS()) {
    return false;
  }
  boolean isNumpadKey=false;
  for (int i=0; i < NUMPAD_KEYCODES.length; ++i) {
    if (NUMPAD_KEYCODES[i] == keyCode) {
      isNumpadKey=true;
      break;
    }
  }
  boolean wasNumLockToggled=false;
  if (isNumpadKey) {
    try {
      m_robot.keyPress(KeyEvent.VK_NUM_LOCK);
      m_robot.keyRelease(KeyEvent.VK_NUM_LOCK);
      m_robot.keyPress(KeyEvent.VK_NUM_LOCK);
      m_robot.keyRelease(KeyEvent.VK_NUM_LOCK);
      final Toolkit defaultToolkit=Toolkit.getDefaultToolkit();
      if (defaultToolkit.getLockingKeyState(KeyEvent.VK_NUM_LOCK)) {
        defaultToolkit.setLockingKeyState(KeyEvent.VK_NUM_LOCK,false);
        wasNumLockToggled=true;
      }
    }
 catch (    UnsupportedOperationException usoe) {
      log.info("String_Node_Str" + "String_Node_Str");
    }
  }
  return wasNumLockToggled;
}
Program: 95848
Project: 95848
Buggy source:
/** 
 * Adds elements to the given cmds List.
 * @param autServerClasspath the server classpath
 * @param cmds the 1st part of the cmd array
 * @param parameters The parameters for starting the AUT.
 */
protected void createAutServerClasspath(StringBuffer autServerClasspath,List cmds,Map parameters){
  if (AutStarter.getInstance().getAutCommunicator() != null) {
    cmds.add(String.valueOf(AutStarter.getInstance().getAutCommunicator().getLocalPort()));
  }
 else {
    cmds.add("String_Node_Str");
  }
  String autMain=getAUTMainClass(parameters);
  if (autMain == null) {
    return;
  }
  cmds.add(autMain);
  autServerClasspath.append(PATH_SEPARATOR).append(getRcBundleClassPath());
  cmds.add(autServerClasspath.toString());
  cmds.add(getServerClassName());
}

Fixed version (ground truth):
/** 
 * Adds elements to the given cmds List.
 * @param autServerClasspath the server classpath
 * @param cmds the 1st part of the cmd array
 * @param parameters The parameters for starting the AUT.
 */
protected void createAutServerClasspath(StringBuffer autServerClasspath,List cmds,Map parameters){
  final Communicator autCommunicator=AutStarter.getInstance().getAutCommunicator();
  if (autCommunicator != null) {
    cmds.add(String.valueOf(autCommunicator.getLocalPort()));
  }
 else {
    cmds.add("String_Node_Str");
  }
  String autMain=getAUTMainClass(parameters);
  if (autMain == null) {
    return;
  }
  cmds.add(autMain);
  autServerClasspath.append(PATH_SEPARATOR).append(getRcBundleClassPath());
  cmds.add(autServerClasspath.toString());
  cmds.add(getServerClassName());
}
Program: 95849
Project: 95849
Buggy source:
/** 
 * Sets -javaagent, JRE arguments and the arguments for  the AutServer as environment variables.
 * @param parameters The parameters for starting the AUT
 * @param autServerClasspath The classpath of the AUT Server
 */
protected void setEnv(Map parameters,String autServerClasspath){
  String env=(String)parameters.get(AutConfigConstants.ENVIRONMENT);
  if (env == null) {
    env=StringConstants.EMPTY;
  }
 else {
    env+=ENV_SEPARATOR;
  }
  env+=setJavaOptions(parameters);
  if (isRunningFromExecutable(parameters)) {
    String serverPort="String_Node_Str";
    if (AutStarter.getInstance().getAutCommunicator() != null) {
      serverPort=String.valueOf(AutStarter.getInstance().getAutCommunicator().getLocalPort());
    }
    env+=ENV_SEPARATOR + "String_Node_Str" + serverPort;
    env+=ENV_SEPARATOR + "String_Node_Str" + autServerClasspath;
    env+=ENV_SEPARATOR + "String_Node_Str" + getServerClassName();
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_AGENT_HOST + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_AGENT_HOST);
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_AGENT_PORT + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_AGENT_PORT);
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_NAME + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_NAME);
  }
  parameters.put(AutConfigConstants.ENVIRONMENT,env);
}

Fixed version (ground truth):
/** 
 * Sets -javaagent, JRE arguments and the arguments for  the AutServer as environment variables.
 * @param parameters The parameters for starting the AUT
 * @param autServerClasspath The classpath of the AUT Server
 */
protected void setEnv(Map parameters,String autServerClasspath){
  String env=(String)parameters.get(AutConfigConstants.ENVIRONMENT);
  if (env == null) {
    env=StringConstants.EMPTY;
  }
 else {
    env+=ENV_SEPARATOR;
  }
  env+=setJavaOptions(parameters);
  if (isRunningFromExecutable(parameters)) {
    String serverPort="String_Node_Str";
    final Communicator autCommunicator=AutStarter.getInstance().getAutCommunicator();
    if (autCommunicator != null) {
      serverPort=String.valueOf(autCommunicator.getLocalPort());
    }
    env+=ENV_SEPARATOR + "String_Node_Str" + serverPort;
    env+=ENV_SEPARATOR + "String_Node_Str" + autServerClasspath;
    env+=ENV_SEPARATOR + "String_Node_Str" + getServerClassName();
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_AGENT_HOST + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_AGENT_HOST);
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_AGENT_PORT + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_AGENT_PORT);
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_NAME + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_NAME);
  }
  parameters.put(AutConfigConstants.ENVIRONMENT,env);
}
Program: 95850
Project: 95850
Buggy source:
/** 
 * Stops the Running AUT with the given ID.
 * @param autId The ID of the Running AUT to stop.
 */
public void stopAUT(AutIdentifier autId){
  fireAndSetAutState(false);
  if (TestExecution.getInstance().getStartedTestSuite() != null && TestExecution.getInstance().getStartedTestSuite().isStarted()) {
    stopTestSuiteAction();
  }
  getClientTest().stopAut(autId);
}

Fixed version (ground truth):
/** 
 * Stops the Running AUT with the given ID.
 * @param autId The ID of the Running AUT to stop.
 */
public void stopAUT(AutIdentifier autId){
  fireAndSetAutState(false);
  final ITestSuitePO startedTestSuite=TestExecution.getInstance().getStartedTestSuite();
  if (startedTestSuite != null && startedTestSuite.isStarted()) {
    stopTestSuiteAction();
  }
  getClientTest().stopAut(autId);
}
Program: 95852
Project: 95852
Buggy source:
/** 
 * Removes the given errorHandler. 
 * @param errorHandler - the listener to remove, null oblects are ignored
 */
public void removeErrorHandler(IErrorHandler errorHandler){
  if (errorHandler != null) {
synchronized (m_errorHandlers) {
      m_errorHandlers.remove(errorHandler);
    }
  }
}

Fixed version (ground truth):
/** 
 * Removes the given errorHandler. 
 * @param errorHandler - the listener to remove, null objects are ignored
 */
public void removeErrorHandler(IErrorHandler errorHandler){
  if (errorHandler != null) {
synchronized (m_errorHandlers) {
      m_errorHandlers.remove(errorHandler);
    }
  }
}
Program: 95853
Project: 95853
Buggy source:
/** 
 * Adds elements to the given cmds List.
 * @param autServerClasspath the server classpath
 * @param cmds the 1st part of the cmd array
 * @param parameters The parameters for starting the AUT.
 */
protected void createAutServerClasspath(StringBuffer autServerClasspath,List cmds,Map parameters){
  final Communicator autCommunicator=AutStarter.getInstance().getAutCommunicator();
  if (autCommunicator != null) {
    cmds.add(String.valueOf(autCommunicator.getLocalPort()));
  }
 else {
    cmds.add("String_Node_Str");
  }
  String autMain=getAUTMainClass(parameters);
  if (autMain == null) {
    return;
  }
  cmds.add(autMain);
  autServerClasspath.append(PATH_SEPARATOR).append(getRcBundleClassPath());
  cmds.add(autServerClasspath.toString());
  cmds.add(getServerClassName());
}

Fixed version (ground truth):
/** 
 * Adds elements to the given cmds List.
 * @param autServerClasspath the server classpath
 * @param cmds the 1st part of the cmd array
 * @param parameters The parameters for starting the AUT.
 */
protected void createAutServerClasspath(StringBuffer autServerClasspath,List cmds,Map parameters){
  if (AutStarter.getInstance().getAutCommunicator() != null) {
    cmds.add(String.valueOf(AutStarter.getInstance().getAutCommunicator().getLocalPort()));
  }
 else {
    cmds.add("String_Node_Str");
  }
  String autMain=getAUTMainClass(parameters);
  if (autMain == null) {
    return;
  }
  cmds.add(autMain);
  autServerClasspath.append(PATH_SEPARATOR).append(getRcBundleClassPath());
  cmds.add(autServerClasspath.toString());
  cmds.add(getServerClassName());
}
Program: 95854
Project: 95854
Buggy source:
/** 
 * Sets -javaagent, JRE arguments and the arguments for  the AutServer as environment variables.
 * @param parameters The parameters for starting the AUT
 * @param autServerClasspath The classpath of the AUT Server
 */
protected void setEnv(Map parameters,String autServerClasspath){
  String env=(String)parameters.get(AutConfigConstants.ENVIRONMENT);
  if (env == null) {
    env=StringConstants.EMPTY;
  }
 else {
    env+=ENV_SEPARATOR;
  }
  env+=setJavaOptions(parameters);
  if (isRunningFromExecutable(parameters)) {
    String serverPort="String_Node_Str";
    final Communicator autCommunicator=AutStarter.getInstance().getAutCommunicator();
    if (autCommunicator != null) {
      serverPort=String.valueOf(autCommunicator.getLocalPort());
    }
    env+=ENV_SEPARATOR + "String_Node_Str" + serverPort;
    env+=ENV_SEPARATOR + "String_Node_Str" + autServerClasspath;
    env+=ENV_SEPARATOR + "String_Node_Str" + getServerClassName();
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_AGENT_HOST + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_AGENT_HOST);
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_AGENT_PORT + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_AGENT_PORT);
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_NAME + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_NAME);
  }
  parameters.put(AutConfigConstants.ENVIRONMENT,env);
}

Fixed version (ground truth):
/** 
 * Sets -javaagent, JRE arguments and the arguments for  the AutServer as environment variables.
 * @param parameters The parameters for starting the AUT
 * @param autServerClasspath The classpath of the AUT Server
 */
protected void setEnv(Map parameters,String autServerClasspath){
  String env=(String)parameters.get(AutConfigConstants.ENVIRONMENT);
  if (env == null) {
    env=StringConstants.EMPTY;
  }
 else {
    env+=ENV_SEPARATOR;
  }
  env+=setJavaOptions(parameters);
  if (isRunningFromExecutable(parameters)) {
    String serverPort="String_Node_Str";
    if (AutStarter.getInstance().getAutCommunicator() != null) {
      serverPort=String.valueOf(AutStarter.getInstance().getAutCommunicator().getLocalPort());
    }
    env+=ENV_SEPARATOR + "String_Node_Str" + serverPort;
    env+=ENV_SEPARATOR + "String_Node_Str" + autServerClasspath;
    env+=ENV_SEPARATOR + "String_Node_Str" + getServerClassName();
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_AGENT_HOST + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_AGENT_HOST);
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_AGENT_PORT + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_AGENT_PORT);
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_NAME + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_NAME);
  }
  parameters.put(AutConfigConstants.ENVIRONMENT,env);
}
Program: 95855
Project: 95855
Buggy source:
/** 
 * Stops the Running AUT with the given ID.
 * @param autId The ID of the Running AUT to stop.
 */
public void stopAUT(AutIdentifier autId){
  fireAndSetAutState(false);
  final ITestSuitePO startedTestSuite=TestExecution.getInstance().getStartedTestSuite();
  if (startedTestSuite != null && startedTestSuite.isStarted()) {
    stopTestSuiteAction();
  }
  getClientTest().stopAut(autId);
}

Fixed version (ground truth):
/** 
 * Stops the Running AUT with the given ID.
 * @param autId The ID of the Running AUT to stop.
 */
public void stopAUT(AutIdentifier autId){
  fireAndSetAutState(false);
  if (TestExecution.getInstance().getStartedTestSuite() != null && TestExecution.getInstance().getStartedTestSuite().isStarted()) {
    stopTestSuiteAction();
  }
  getClientTest().stopAut(autId);
}
Program: 95857
Project: 95857
Buggy source:
/** 
 * Removes the given errorHandler. 
 * @param errorHandler - the listener to remove, null objects are ignored
 */
public void removeErrorHandler(IErrorHandler errorHandler){
  if (errorHandler != null) {
synchronized (m_errorHandlers) {
      m_errorHandlers.remove(errorHandler);
    }
  }
}

Fixed version (ground truth):
/** 
 * Removes the given errorHandler. 
 * @param errorHandler - the listener to remove, null oblects are ignored
 */
public void removeErrorHandler(IErrorHandler errorHandler){
  if (errorHandler != null) {
synchronized (m_errorHandlers) {
      m_errorHandlers.remove(errorHandler);
    }
  }
}
Program: 95858
Project: 95858
Buggy source:
/** 
 * Adds elements to the given cmds List.
 * @param autServerClasspath the server classpath
 * @param cmds the 1st part of the cmd array
 * @param parameters The parameters for starting the AUT.
 */
protected void createAutServerClasspath(StringBuffer autServerClasspath,List cmds,Map parameters){
  if (AutStarter.getInstance().getAutCommunicator() != null) {
    cmds.add(String.valueOf(AutStarter.getInstance().getAutCommunicator().getLocalPort()));
  }
 else {
    cmds.add("String_Node_Str");
  }
  String autMain=getAUTMainClass(parameters);
  if (autMain == null) {
    return;
  }
  cmds.add(autMain);
  autServerClasspath.append(PATH_SEPARATOR).append(getRcBundleClassPath());
  cmds.add(autServerClasspath.toString());
  cmds.add(getServerClassName());
}

Fixed version (ground truth):
/** 
 * Adds elements to the given cmds List.
 * @param autServerClasspath the server classpath
 * @param cmds the 1st part of the cmd array
 * @param parameters The parameters for starting the AUT.
 */
protected void createAutServerClasspath(StringBuffer autServerClasspath,List cmds,Map parameters){
  final Communicator autCommunicator=AutStarter.getInstance().getAutCommunicator();
  if (autCommunicator != null) {
    cmds.add(String.valueOf(autCommunicator.getLocalPort()));
  }
 else {
    cmds.add("String_Node_Str");
  }
  String autMain=getAUTMainClass(parameters);
  if (autMain == null) {
    return;
  }
  cmds.add(autMain);
  autServerClasspath.append(PATH_SEPARATOR).append(getRcBundleClassPath());
  cmds.add(autServerClasspath.toString());
  cmds.add(getServerClassName());
}
Program: 95859
Project: 95859
Buggy source:
/** 
 * Sets -javaagent, JRE arguments and the arguments for  the AutServer as environment variables.
 * @param parameters The parameters for starting the AUT
 * @param autServerClasspath The classpath of the AUT Server
 */
protected void setEnv(Map parameters,String autServerClasspath){
  String env=(String)parameters.get(AutConfigConstants.ENVIRONMENT);
  if (env == null) {
    env=StringConstants.EMPTY;
  }
 else {
    env+=ENV_SEPARATOR;
  }
  env+=setJavaOptions(parameters);
  if (isRunningFromExecutable(parameters)) {
    String serverPort="String_Node_Str";
    if (AutStarter.getInstance().getAutCommunicator() != null) {
      serverPort=String.valueOf(AutStarter.getInstance().getAutCommunicator().getLocalPort());
    }
    env+=ENV_SEPARATOR + "String_Node_Str" + serverPort;
    env+=ENV_SEPARATOR + "String_Node_Str" + autServerClasspath;
    env+=ENV_SEPARATOR + "String_Node_Str" + getServerClassName();
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_AGENT_HOST + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_AGENT_HOST);
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_AGENT_PORT + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_AGENT_PORT);
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_NAME + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_NAME);
  }
  parameters.put(AutConfigConstants.ENVIRONMENT,env);
}

Fixed version (ground truth):
/** 
 * Sets -javaagent, JRE arguments and the arguments for  the AutServer as environment variables.
 * @param parameters The parameters for starting the AUT
 * @param autServerClasspath The classpath of the AUT Server
 */
protected void setEnv(Map parameters,String autServerClasspath){
  String env=(String)parameters.get(AutConfigConstants.ENVIRONMENT);
  if (env == null) {
    env=StringConstants.EMPTY;
  }
 else {
    env+=ENV_SEPARATOR;
  }
  env+=setJavaOptions(parameters);
  if (isRunningFromExecutable(parameters)) {
    String serverPort="String_Node_Str";
    final Communicator autCommunicator=AutStarter.getInstance().getAutCommunicator();
    if (autCommunicator != null) {
      serverPort=String.valueOf(autCommunicator.getLocalPort());
    }
    env+=ENV_SEPARATOR + "String_Node_Str" + serverPort;
    env+=ENV_SEPARATOR + "String_Node_Str" + autServerClasspath;
    env+=ENV_SEPARATOR + "String_Node_Str" + getServerClassName();
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_AGENT_HOST + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_AGENT_HOST);
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_AGENT_PORT + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_AGENT_PORT);
    env+=ENV_SEPARATOR + AutConfigConstants.AUT_NAME + "String_Node_Str"+ parameters.get(AutConfigConstants.AUT_NAME);
  }
  parameters.put(AutConfigConstants.ENVIRONMENT,env);
}
Program: 95860
Project: 95860
Buggy source:
/** 
 * Stops the Running AUT with the given ID.
 * @param autId The ID of the Running AUT to stop.
 */
public void stopAUT(AutIdentifier autId){
  fireAndSetAutState(false);
  if (TestExecution.getInstance().getStartedTestSuite() != null && TestExecution.getInstance().getStartedTestSuite().isStarted()) {
    stopTestSuiteAction();
  }
  getClientTest().stopAut(autId);
}

Fixed version (ground truth):
/** 
 * Stops the Running AUT with the given ID.
 * @param autId The ID of the Running AUT to stop.
 */
public void stopAUT(AutIdentifier autId){
  fireAndSetAutState(false);
  final ITestSuitePO startedTestSuite=TestExecution.getInstance().getStartedTestSuite();
  if (startedTestSuite != null && startedTestSuite.isStarted()) {
    stopTestSuiteAction();
  }
  getClientTest().stopAut(autId);
}
Program: 95862
Project: 95862
Buggy source:
/** 
 * Removes the given errorHandler. 
 * @param errorHandler - the listener to remove, null oblects are ignored
 */
public void removeErrorHandler(IErrorHandler errorHandler){
  if (errorHandler != null) {
synchronized (m_errorHandlers) {
      m_errorHandlers.remove(errorHandler);
    }
  }
}

Fixed version (ground truth):
/** 
 * Removes the given errorHandler. 
 * @param errorHandler - the listener to remove, null objects are ignored
 */
public void removeErrorHandler(IErrorHandler errorHandler){
  if (errorHandler != null) {
synchronized (m_errorHandlers) {
      m_errorHandlers.remove(errorHandler);
    }
  }
}
Program: 95864
Project: 95864
Buggy source:
/** 
 * constructor Jframe
 */
public ChooseCheckModeDialog(){
  super();
  try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
catch (  InstantiationException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  UnsupportedLookAndFeelException e) {
    e.printStackTrace();
  }
  createPart();
}

Fixed version (ground truth):
/** 
 * constructor Jframe
 */
public ChooseCheckModeDialog(){
  super();
  createPart();
}
Program: 95865
Project: 95865
Buggy source:
/** 
 * constructor Jframe
 */
public ObservationConsole(){
  super();
  try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
catch (  InstantiationException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  UnsupportedLookAndFeelException e) {
    e.printStackTrace();
  }
  createPart();
}

Fixed version (ground truth):
/** 
 * constructor Jframe
 */
public ObservationConsole(){
  super();
  createPart();
}
Program: 95866
Project: 95866
Buggy source:
/** 
 * Overides Object.equals() Compares this TestDataPO object to the given object to equality.
 * @param obj the object to compare.
 * @return true or false{@inheritDoc}
 */
public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj instanceof TestDataPO) {
    TestDataPO otherTestData=(TestDataPO)obj;
    return getMap().equals(otherTestData.getMap());
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Overrides Object.equals() Compares this TestDataPO object to the given object to equality.
 * @param obj the object to compare.
 * @return true or false{@inheritDoc}
 */
public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj instanceof TestDataPO) {
    TestDataPO otherTestData=(TestDataPO)obj;
    return getMap().equals(otherTestData.getMap());
  }
  return false;
}
Program: 95867
Project: 95867
Buggy source:
/** 
 * because of Persistence (JPA / EclipseLink)-Bug HHH-1280 we can't use refresh<br> therefore we use evict to remove the old object from master session and reload the object<br> please attend, that in this case the Java-IDs of the old and the reloaded object are different<br> refreshs the original versions, which were possibly modified in editor
 * @throws ProjectDeletedException if the project was deleted in another instance
 */
private void refreshOriginalVersions() throws ProjectDeletedException {
  try {
    final EntityManager masterSession=GeneralStorage.getInstance().getMasterSession();
    IPersistentObject original=getOriginal();
    if (original != null) {
      masterSession.refresh(original);
      GeneralStorage.getInstance().fireDataModified(original);
    }
  }
 catch (  PersistenceException e) {
    log.error(Messages.RefreshOfOriginalVersionFailed + StringConstants.DOT,e);
    GeneralStorage.getInstance().reloadMasterSession(new NullProgressMonitor());
  }
}

Fixed version (ground truth):
/** 
 * Refreshes the original versions, which were possibly modified in editor
 * @throws ProjectDeletedException if the project was deleted in another instance
 */
private void refreshOriginalVersions() throws ProjectDeletedException {
  try {
    final EntityManager masterSession=GeneralStorage.getInstance().getMasterSession();
    IPersistentObject original=getOriginal();
    if (original != null) {
      masterSession.refresh(masterSession.merge(getWorkVersion()));
      GeneralStorage.getInstance().fireDataModified(original);
    }
  }
 catch (  PersistenceException e) {
    log.error(Messages.RefreshOfOriginalVersionFailed + StringConstants.DOT,e);
    GeneralStorage.getInstance().reloadMasterSession(new NullProgressMonitor());
  }
}
Program: 95869
Project: 95869
Buggy source:
/** 
 * {@inheritDoc} 
 */
public boolean operate(ITreeTraverserContext<TestResultNode> ctx,TestResultNode parent,TestResultNode resultNode,boolean alreadyVisited){
  m_nodeCount++;
  boolean didNodePass=CommentEntry.hasPassed(resultNode.getStatus());
  INodePO node=resultNode.getNode();
  String taskIdforNode=NodePropertyTester.getTaskIdforNode(node);
  boolean hasTaskId=taskIdforNode != null;
  boolean writeCommentForNode=hasTaskId && (m_reportSuccess && didNodePass) || (m_reportFailure && !didNodePass);
  if (writeCommentForNode) {
    CommentEntry c=new CommentEntry(resultNode,m_dashboardURL,m_summaryIdString,m_nodeCount);
    List<CommentEntry> comments=m_taskIdToComment.get(taskIdforNode);
    if (comments != null) {
      comments.add(c);
    }
 else {
      List<CommentEntry> cs=new LinkedList<CommentEntry>();
      cs.add(c);
      m_taskIdToComment.put(taskIdforNode,cs);
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public boolean operate(ITreeTraverserContext<TestResultNode> ctx,TestResultNode parent,TestResultNode resultNode,boolean alreadyVisited){
  m_nodeCount++;
  boolean didNodePass=CommentEntry.hasPassed(resultNode.getStatus());
  INodePO node=resultNode.getNode();
  String taskIdforNode=NodePropertyTester.getTaskIdforNode(node);
  boolean hasTaskId=taskIdforNode != null;
  boolean writeCommentForNode=hasTaskId && ((m_reportSuccess && didNodePass) || (m_reportFailure && !didNodePass));
  if (writeCommentForNode) {
    CommentEntry c=new CommentEntry(resultNode,m_dashboardURL,m_summaryIdString,m_nodeCount);
    List<CommentEntry> comments=m_taskIdToComment.get(taskIdforNode);
    if (comments != null) {
      comments.add(c);
    }
 else {
      List<CommentEntry> cs=new LinkedList<CommentEntry>();
      cs.add(c);
      m_taskIdToComment.put(taskIdforNode,cs);
    }
  }
  return true;
}
Program: 95870
Project: 95870
Buggy source:
/** 
 * @param commentEntries the commentEntries to add
 * @param attr the attribute to modify
 * @return a flag indicating the success of attribute handling
 */
private static TaskAttribute hpAlmHandling(List<CommentEntry> commentEntries,TaskAttribute attr){
  Properties almProps=Activator.getDefault().getAlmAccessProperties();
  String hpTaskKindKeyPrefix=CONNECTOR.HP_ALM.toString() + StringConstants.DOT + TaskAttribute.TASK_KIND;
  String req=hpTaskKindKeyPrefix + "String_Node_Str";
  String hpTaskKindReq=almProps.getProperty(req);
  String def=hpTaskKindKeyPrefix + "String_Node_Str";
  String hpTaskKindDefect=almProps.getProperty(def);
  String taskKindValue=attr.getMappedAttribute(TaskAttribute.TASK_KIND).getValue();
  String attrName=null;
  if (hpTaskKindReq.equals(taskKindValue)) {
    attrName=almProps.getProperty(req + "String_Node_Str");
  }
 else   if (hpTaskKindDefect.equals(taskKindValue)) {
    attrName=almProps.getProperty(def + "String_Node_Str");
  }
  if (attrName != null) {
    TaskAttribute commentAttribute=attr.getMappedAttribute(attrName);
    String oldComment=commentAttribute.getValue();
    String newComment=StringConstants.EMPTY;
    for (    CommentEntry c : commentEntries) {
      newComment=newComment + "String_Node_Str" + c.getDashboardURL()+ "String_Node_Str"+ c.toString()+ "String_Node_Str";
    }
    commentAttribute.setValue(oldComment + newComment);
    return commentAttribute;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param commentEntries the commentEntries to add
 * @param attr the attribute to modify
 * @return a flag indicating the success of attribute handling
 */
private static TaskAttribute hpAlmHandling(List<CommentEntry> commentEntries,TaskAttribute attr){
  Properties almProps=Activator.getDefault().getAlmAccessProperties();
  String hpTaskKindKeyPrefix=CONNECTOR.HP_ALM.toString() + StringConstants.DOT + TaskAttribute.TASK_KIND;
  String req=hpTaskKindKeyPrefix + "String_Node_Str";
  String hpTaskKindReq=almProps.getProperty(req);
  String def=hpTaskKindKeyPrefix + "String_Node_Str";
  String hpTaskKindDefect=almProps.getProperty(def);
  String taskKindValue=attr.getMappedAttribute(TaskAttribute.TASK_KIND).getValue();
  String attrName=null;
  if (hpTaskKindReq.equals(taskKindValue)) {
    attrName=almProps.getProperty(req + "String_Node_Str");
  }
 else   if (hpTaskKindDefect.equals(taskKindValue)) {
    attrName=almProps.getProperty(def + "String_Node_Str");
  }
  if (attrName != null) {
    TaskAttribute commentAttribute=attr.getMappedAttribute(attrName);
    String oldComment=commentAttribute.getValue();
    String newComment=StringConstants.EMPTY;
    for (    CommentEntry c : commentEntries) {
      newComment=newComment + "String_Node_Str" + c.toString()+ "String_Node_Str"+ c.getDashboardURL();
    }
    commentAttribute.setValue(oldComment + newComment);
    return commentAttribute;
  }
  return null;
}
Program: 95871
Project: 95871
Buggy source:
/** 
 * Constructor
 * @param resultNode the node
 * @param dashboardURL the URL
 * @param summaryId the id
 * @param nodeCount the node count
 */
public CommentEntry(TestResultNode resultNode,String dashboardURL,String summaryId,Long nodeCount){
  m_dashboardURL=dashboardURL;
  m_summaryId=summaryId;
  m_nodeCount=nodeCount;
  Date executionTime=resultNode.getTimeStamp();
  if (executionTime != null) {
    m_timestamp=executionTime.toString();
  }
 else {
    m_timestamp=Messages.NotAvailable;
  }
  m_nodeType=resultNode.getTypeOfNode();
  m_nodeNameAndParams=getName(resultNode) + StringConstants.SPACE + StringUtils.abbreviate(resultNode.getParameterDescription(),MAX_DATA_STRING_LENGTH);
  if (hasPassed(resultNode.getStatus())) {
    m_status=Messages.StatusPassed;
  }
 else {
    m_status=Messages.StatusFailed;
  }
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param resultNode the node
 * @param dashboardURL the URL
 * @param summaryId the id
 * @param nodeCount the node count
 */
public CommentEntry(TestResultNode resultNode,String dashboardURL,String summaryId,Long nodeCount){
  m_dashboardURL=dashboardURL;
  m_summaryId=summaryId;
  m_nodeCount=nodeCount;
  Date executionTime=resultNode.getTimeStamp();
  if (executionTime != null) {
    m_timestamp=executionTime.toString();
  }
 else {
    m_timestamp=Messages.NotAvailable;
  }
  m_nodeType=resultNode.getTypeOfNode();
  String paramDescription=StringUtils.abbreviate(resultNode.getParameterDescription(),MAX_DATA_STRING_LENGTH);
  m_nodeNameAndParams=getName(resultNode);
  if (!StringUtils.isBlank(paramDescription)) {
    m_nodeNameAndParams+=StringConstants.SPACE + paramDescription;
  }
  if (hasPassed(resultNode.getStatus())) {
    m_status=Messages.StatusPassed;
  }
 else {
    m_status=Messages.StatusFailed;
  }
}
Program: 95872
Project: 95872
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void handleTestresultSummaryChanged(final ITestResultSummaryPO summary,DataState state){
  if (state != DataState.Added) {
    return;
  }
  IProjectPO project=GeneralStorage.getInstance().getProject();
  m_projProps=project.getProjectProperties();
  final boolean reportSuccess=m_projProps.getIsReportOnSuccess();
  final boolean reportFailure=m_projProps.getIsReportOnFailure();
  final String almRepositoryName=m_projProps.getALMRepositoryName();
  if (!StringUtils.isBlank(almRepositoryName) && (reportSuccess || reportFailure)) {
    Job reportToALMOperation=new Job(NLS.bind(Messages.ReportToALMJob,almRepositoryName)){
      protected IStatus run(      IProgressMonitor monitor){
        getConsole().writeLine(NLS.bind(Messages.TaskRepositoryConnectionTest,almRepositoryName));
        IStatus connectionStatus=ALMAccess.testConnection(almRepositoryName);
        if (connectionStatus.isOK()) {
          getConsole().writeLine(NLS.bind(Messages.TaskRepositoryConnectionTestSucceeded,almRepositoryName));
          return processResultTree(monitor,reportSuccess,reportFailure,summary);
        }
        getConsole().writeErrorLine(NLS.bind(Messages.TaskRepositoryConnectionTestFailed,connectionStatus.getMessage()));
        return connectionStatus;
      }
    }
;
    reportToALMOperation.schedule();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void handleTestresultSummaryChanged(final ITestResultSummaryPO summary,DataState state){
  if (state != DataState.Added) {
    return;
  }
  IProjectPO project=GeneralStorage.getInstance().getProject();
  m_projProps=project.getProjectProperties();
  final boolean reportSuccess=m_projProps.getIsReportOnSuccess();
  final boolean reportFailure=m_projProps.getIsReportOnFailure();
  final String almRepositoryName=m_projProps.getALMRepositoryName();
  if (!StringUtils.isBlank(almRepositoryName) && (reportSuccess || reportFailure)) {
    Job reportToALMOperation=new Job(NLS.bind(Messages.ReportToALMJobName,almRepositoryName)){
      protected IStatus run(      IProgressMonitor monitor){
        getConsole().writeLine(NLS.bind(Messages.TaskRepositoryConnectionTest,almRepositoryName));
        IStatus connectionStatus=ALMAccess.testConnection(almRepositoryName);
        if (connectionStatus.isOK()) {
          getConsole().writeLine(NLS.bind(Messages.TaskRepositoryConnectionTestSucceeded,almRepositoryName));
          return processResultTree(monitor,reportSuccess,reportFailure,summary);
        }
        getConsole().writeErrorLine(NLS.bind(Messages.TaskRepositoryConnectionTestFailed,connectionStatus.getMessage()));
        return connectionStatus;
      }
    }
;
    reportToALMOperation.schedule();
  }
}
Program: 95873
Project: 95873
Buggy source:
/** 
 * method to find all classes in a given jar
 * @param resource The url to the jar file
 * @param pkgname The package name for classes found inside the base directory
 * @return The classes
 */
private static List findClassesInJar(URL resource,String pkgname){
  String relPath=pkgname.replace('.','/');
  String path=resource.getPath().replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str");
  List classes=new ArrayList();
  try {
    JarFile jarFile=new JarFile(path);
    Enumeration entries=jarFile.entries();
    while (entries.hasMoreElements()) {
      JarEntry entry=(JarEntry)entries.nextElement();
      String entryName=entry.getName();
      String className=null;
      if (entryName.endsWith("String_Node_Str") && entryName.startsWith(relPath)) {
        className=entryName.replace('/','.').replace('\\','.').replaceAll("String_Node_Str","String_Node_Str");
        if (className != null) {
          try {
            classes.add(Class.forName(className));
          }
 catch (          ClassNotFoundException cnfe) {
            log.error(cnfe.getLocalizedMessage(),cnfe);
          }
        }
      }
    }
  }
 catch (  IOException ioe) {
    log.warn(ioe.getLocalizedMessage(),ioe);
  }
  return classes;
}

Fixed version (ground truth):
/** 
 * method to find all classes in a given jar
 * @param resource The url to the jar file
 * @param pkgname The package name for classes found inside the base directory
 * @return The classes
 */
private static List findClassesInJar(URL resource,String pkgname){
  String relPath=pkgname.replace('.','/');
  String path=resource.getPath().replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str");
  try {
    path=URLDecoder.decode(path,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException uee) {
    log.error(uee.getLocalizedMessage(),uee);
  }
  List classes=new ArrayList();
  try {
    JarFile jarFile=new JarFile(path);
    Enumeration entries=jarFile.entries();
    while (entries.hasMoreElements()) {
      JarEntry entry=(JarEntry)entries.nextElement();
      String entryName=entry.getName();
      String className=null;
      if (entryName.endsWith("String_Node_Str") && entryName.startsWith(relPath)) {
        className=entryName.replace('/','.').replace('\\','.').replaceAll("String_Node_Str","String_Node_Str");
        if (className != null) {
          try {
            classes.add(Class.forName(className));
          }
 catch (          ClassNotFoundException cnfe) {
            log.error(cnfe.getLocalizedMessage(),cnfe);
          }
        }
      }
    }
  }
 catch (  IOException ioe) {
    log.warn(ioe.getLocalizedMessage(),ioe);
  }
  return classes;
}
Program: 95875
Project: 95875
Buggy source:
/** 
 * @param monitor the monitor to use
 * @param taskIdToComment the comment mapping
 * @return status
 */
private IStatus reportToALM(IProgressMonitor monitor,Map<String,List<CommentEntry>> taskIdToComment){
  String repoLabel=m_projProps.getALMRepositoryName();
  Set<String> taskIds=taskIdToComment.keySet();
  int taskAmount=taskIds.size();
  String out=NLS.bind(Messages.ReportToALMJob,repoLabel);
  monitor.beginTask(out,taskAmount);
  IProgressConsole c=getConsole();
  c.writeLine(out);
  for (  String taskId : taskIds) {
    c.writeLine(NLS.bind(Messages.ReportingTask,taskId));
    boolean succeeded=ALMAccess.createComment(repoLabel,taskId,taskIdToComment.get(taskId),monitor);
    if (!succeeded) {
      c.writeErrorLine(NLS.bind(Messages.ReportingTaskFailed,taskId));
    }
    monitor.worked(1);
  }
  c.writeLine(Messages.ReportToALMJobDone);
  monitor.done();
  return Status.OK_STATUS;
}

Fixed version (ground truth):
/** 
 * @param monitor the monitor to use
 * @param taskIdToComment the comment mapping
 * @return status
 */
private IStatus reportToALM(IProgressMonitor monitor,Map<String,List<CommentEntry>> taskIdToComment){
  String repoLabel=m_projProps.getALMRepositoryName();
  Set<String> taskIds=taskIdToComment.keySet();
  int taskAmount=taskIds.size();
  IProgressConsole c=getConsole();
  if (taskAmount > 0) {
    String out=NLS.bind(Messages.ReportToALMJob,taskAmount,repoLabel);
    monitor.beginTask(out,taskAmount);
    c.writeLine(out);
    int successCount=0;
    int overallCommentCount=0;
    for (    String taskId : taskIds) {
      List<CommentEntry> comments=taskIdToComment.get(taskId);
      int commentAmount=comments.size();
      if (commentAmount > 1) {
        c.writeLine(NLS.bind(Messages.ReportingResults,commentAmount,taskId));
      }
 else {
        c.writeLine(NLS.bind(Messages.ReportingResult,taskId));
      }
      boolean succeeded=ALMAccess.createComment(repoLabel,taskId,comments,monitor);
      if (!succeeded) {
        c.writeErrorLine(NLS.bind(Messages.ReportingTaskFailed,taskId));
      }
 else {
        successCount++;
        overallCommentCount+=commentAmount;
      }
      monitor.worked(1);
    }
    c.writeLine(NLS.bind(Messages.ReportToALMJobDone,new Integer[]{overallCommentCount,successCount,taskAmount}));
    monitor.done();
  }
 else {
    c.writeLine(Messages.NothingToReport);
  }
  return Status.OK_STATUS;
}