nus-yam/ex-repair huggingface dataset:
Program: 119384
Project: 119384
Buggy source:
public void dispose(){
}

Fixed version (ground truth):
@Override public void dispose(){
}
Program: 119385
Project: 119385
Buggy source:
public boolean isLabelProperty(Object element,String property){
  return false;
}

Fixed version (ground truth):
@Override public boolean isLabelProperty(Object element,String property){
  return false;
}
Program: 119386
Project: 119386
Buggy source:
public Image getImage(Object element){
  return null;
}

Fixed version (ground truth):
@Override public Image getImage(Object element){
  return null;
}
Program: 119392
Project: 119392
Buggy source:
@Override protected void checkVisibleTopMessages(){
  missModulesNeeded.clear();
  final Element ele=this.getElement();
  if (ele instanceof Node) {
    List<ModuleNeeded> modules=new ArrayList<ModuleNeeded>();
    JavaProcessUtil.addNodeRelatedModules(((Node)ele).getProcess(),modules,((Node)ele));
    List<ModuleNeeded> updatedModules=LibrariesManagerUtils.getNotInstalledModules(modules);
    missModulesNeeded.addAll(updatedModules);
  }
  setVisibleTopMessage(!missModulesNeeded.isEmpty());
}

Fixed version (ground truth):
@Override protected void checkVisibleTopMessages(){
  missModulesNeeded.clear();
  final Element ele=this.getElement();
  if (ele instanceof Node) {
    List<ModuleNeeded> modules=new ArrayList<ModuleNeeded>();
    JavaProcessUtil.addNodeRelatedModules(((Node)ele).getProcess(),modules,((Node)ele));
    List<ModuleNeeded> updatedModules=LibrariesManagerUtils.getNotInstalledModules(modules);
    for (    ModuleNeeded needed : updatedModules) {
      if (needed.isRequired(((Node)ele).getElementParameters())) {
        needed.setRequired(true);
      }
    }
    missModulesNeeded.addAll(updatedModules);
  }
  setVisibleTopMessage(!missModulesNeeded.isEmpty());
}
Program: 119393
Project: 119393
Buggy source:
/** 
 * yzhang Comment method "setPropertiesViewerTitle".
 * @param elem
 */
private void setPropertiesViewerTitle(Element elem){
  String label=null;
  Image image=null;
  if (elem instanceof Node) {
    label=((Node)elem).getLabel();
    String uniqueName=((Node)elem).getUniqueName();
    if (!label.equals(uniqueName)) {
      label=label + "String_Node_Str" + uniqueName+ "String_Node_Str";
    }
    image=CoreImageProvider.getComponentIcon(((Node)elem).getComponent(),ICON_SIZE.ICON_24);
  }
 else   if (elem instanceof Connection) {
    label=((Connection)elem).getElementName();
    image=ImageProvider.getImage(EImage.RIGHT_ICON);
  }
 else   if (elem instanceof Note) {
    label=Messages.getString("String_Node_Str");
    image=ImageProvider.getImage(EImage.PASTE_ICON);
  }
 else   if (elem instanceof SubjobContainer) {
    label=Messages.getString("String_Node_Str");
    image=ImageProvider.getImage(EImage.PASTE_ICON);
  }
  tabFactory.setTitle(label,image);
  super.setTitleToolTip(label);
}

Fixed version (ground truth):
/** 
 * yzhang Comment method "setPropertiesViewerTitle".
 * @param elem
 */
private void setPropertiesViewerTitle(Element elem){
  String label=null;
  Image image=null;
  if (elem instanceof Node) {
    label=((Node)elem).getLabel();
    String uniqueName=((Node)elem).getUniqueName();
    if (!label.equals(uniqueName)) {
      label=label + "String_Node_Str" + uniqueName+ "String_Node_Str";
    }
    image=CoreImageProvider.getComponentIcon(((Node)elem).getComponent(),ICON_SIZE.ICON_24);
  }
 else   if (elem instanceof Connection) {
    label=((Connection)elem).getElementName();
    image=ImageProvider.getImage(EImage.RIGHT_ICON);
  }
 else   if (elem instanceof Note) {
    label=Messages.getString("String_Node_Str");
    image=ImageProvider.getImage(EImage.PASTE_ICON);
  }
 else   if (elem instanceof SubjobContainer) {
    label=Messages.getString("String_Node_Str");
    image=ImageProvider.getImage(EImage.PASTE_ICON);
  }
 else   if (elem instanceof ConnectionLabel) {
    label=((ConnectionLabel)elem).getConnection().getElementName();
    image=ImageProvider.getImage(EImage.RIGHT_ICON);
  }
  tabFactory.setTitle(label,image);
  super.setTitleToolTip(label);
}
Program: 119398
Project: 119398
Buggy source:
@Override public void setFocus(){
  IComponentSettingsView viewer=(IComponentSettingsView)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IComponentSettingsView.ID);
  if (viewer != null) {
    IStructuredSelection selection=(IStructuredSelection)getViewer().getSelection();
    if (selection.size() == 1 && (selection.getFirstElement() instanceof NodePart || selection.getFirstElement() instanceof ConnectionPart)) {
      viewer.setElement((Element)((AbstractEditPart)selection.getFirstElement()).getModel());
    }
 else {
      viewer.cleanDisplay();
    }
  }
  JobSettings.switchToCurJobSettingsView();
  super.setFocus();
  if (!readOnly) {
    List children=getViewer().getRootEditPart().getChildren();
    if (!children.isEmpty()) {
      ProcessPart rep=(ProcessPart)children.get(0);
      rep.ajustReadOnly();
    }
  }
}

Fixed version (ground truth):
@Override public void setFocus(){
  IComponentSettingsView viewer=(IComponentSettingsView)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IComponentSettingsView.ID);
  if (viewer != null) {
    IStructuredSelection selection=(IStructuredSelection)getViewer().getSelection();
    if (selection.size() == 1 && (selection.getFirstElement() instanceof NodePart || selection.getFirstElement() instanceof ConnectionPart || selection.getFirstElement() instanceof SubjobContainerPart|| selection.getFirstElement() instanceof ConnLabelEditPart)) {
      viewer.setElement((Element)((AbstractEditPart)selection.getFirstElement()).getModel());
    }
 else {
      viewer.cleanDisplay();
    }
  }
  JobSettings.switchToCurJobSettingsView();
  super.setFocus();
  if (!readOnly) {
    List children=getViewer().getRootEditPart().getChildren();
    if (!children.isEmpty()) {
      ProcessPart rep=(ProcessPart)children.get(0);
      rep.ajustReadOnly();
    }
  }
}
Program: 119400
Project: 119400
Buggy source:
@Override public void selectionChanged(SelectionChangedEvent event){
  IStructuredSelection selection=(IStructuredSelection)event.getSelection();
  TalendPropertyTabDescriptor descriptor=(TalendPropertyTabDescriptor)selection.getFirstElement();
  if (descriptor == null) {
    return;
  }
  if (currentSelectedTab != null && (!currentSelectedTab.getData().equals(descriptor.getData()) || currentSelectedTab.getCategory() != descriptor.getCategory())) {
    for (    Control curControl : tabFactory.getTabComposite().getChildren()) {
      curControl.dispose();
    }
  }
  if (element == null || !element.equals(descriptor.getData()) || currentSelectedTab == null || currentSelectedTab.getCategory() != descriptor.getCategory() || selectedPrimary) {
    element=(Element)descriptor.getData();
    currentSelectedTab=descriptor;
    createDynamicComposite(tabFactory.getTabComposite(),(Element)descriptor.getData(),descriptor.getCategory());
    selectedPrimary=false;
  }
}

Fixed version (ground truth):
@Override public void selectionChanged(SelectionChangedEvent event){
  IStructuredSelection selection=(IStructuredSelection)event.getSelection();
  TalendPropertyTabDescriptor descriptor=(TalendPropertyTabDescriptor)selection.getFirstElement();
  if (descriptor == null) {
    return;
  }
  if (currentSelectedTab != null && (!currentSelectedTab.getData().equals(descriptor.getData()) || currentSelectedTab.getCategory() != descriptor.getCategory())) {
    for (    Control curControl : tabFactory.getTabComposite().getChildren()) {
      curControl.dispose();
    }
  }
  if (element == null || !element.equals(descriptor.getData()) || currentSelectedTab == null || currentSelectedTab.getCategory() != descriptor.getCategory() || selectedPrimary) {
    element=(Element)descriptor.getData();
    currentSelectedTab=descriptor;
    if (descriptor.getData() instanceof ConnectionLabel) {
      createDynamicComposite(tabFactory.getTabComposite(),((ConnectionLabel)descriptor.getData()).getConnection(),descriptor.getCategory());
    }
 else {
      createDynamicComposite(tabFactory.getTabComposite(),(Element)descriptor.getData(),descriptor.getCategory());
    }
    selectedPrimary=false;
  }
}
Program: 119401
Project: 119401
Buggy source:
@Override public void createPartControl(Composite parent){
  this.parent=parent;
  tabFactory.initComposite(parent,true);
  tabFactory.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      IStructuredSelection selection=(IStructuredSelection)event.getSelection();
      TalendPropertyTabDescriptor descriptor=(TalendPropertyTabDescriptor)selection.getFirstElement();
      if (descriptor == null) {
        return;
      }
      if (currentSelectedTab != null && (!currentSelectedTab.getData().equals(descriptor.getData()) || currentSelectedTab.getCategory() != descriptor.getCategory())) {
        for (        Control curControl : tabFactory.getTabComposite().getChildren()) {
          curControl.dispose();
        }
      }
      if (element == null || !element.equals(descriptor.getData()) || currentSelectedTab == null || currentSelectedTab.getCategory() != descriptor.getCategory() || selectedPrimary) {
        element=(Element)descriptor.getData();
        currentSelectedTab=descriptor;
        createDynamicComposite(tabFactory.getTabComposite(),(Element)descriptor.getData(),descriptor.getCategory());
        selectedPrimary=false;
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  this.parent=parent;
  tabFactory.initComposite(parent,true);
  tabFactory.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      IStructuredSelection selection=(IStructuredSelection)event.getSelection();
      TalendPropertyTabDescriptor descriptor=(TalendPropertyTabDescriptor)selection.getFirstElement();
      if (descriptor == null) {
        return;
      }
      if (currentSelectedTab != null && (!currentSelectedTab.getData().equals(descriptor.getData()) || currentSelectedTab.getCategory() != descriptor.getCategory())) {
        for (        Control curControl : tabFactory.getTabComposite().getChildren()) {
          curControl.dispose();
        }
      }
      if (element == null || !element.equals(descriptor.getData()) || currentSelectedTab == null || currentSelectedTab.getCategory() != descriptor.getCategory() || selectedPrimary) {
        element=(Element)descriptor.getData();
        currentSelectedTab=descriptor;
        if (descriptor.getData() instanceof ConnectionLabel) {
          createDynamicComposite(tabFactory.getTabComposite(),((ConnectionLabel)descriptor.getData()).getConnection(),descriptor.getCategory());
        }
 else {
          createDynamicComposite(tabFactory.getTabComposite(),(Element)descriptor.getData(),descriptor.getCategory());
        }
        selectedPrimary=false;
      }
    }
  }
);
}
Program: 119408
Project: 119408
Buggy source:
/** 
 * Sets the editor.
 * @param editor the editor to set
 */
public void setEditor(AbstractMultiPageTalendEditor editor){
  this.editor=editor;
  if (editor != null && !duplicate) {
    CommandStack commandStack=(CommandStack)editor.getTalendEditor().getAdapter(CommandStack.class);
    commandStack.addCommandStackEventListener(commandStackEventListener);
    getUpdateManager().updateAll();
    IEclipsePreferences projectPreferences=(IEclipsePreferences)Log4jPrefsSettingManager.getInstance().getLog4jPreferences(Log4jPrefsConstants.LOG4J_ENABLE_NODE,false);
    projectPreferences.addPreferenceChangeListener(preferenceEventListener);
  }
}

Fixed version (ground truth):
/** 
 * Sets the editor.
 * @param editor the editor to set
 */
public void setEditor(AbstractMultiPageTalendEditor editor){
  this.editor=editor;
  if (editor != null && !duplicate) {
    CommandStack commandStack=(CommandStack)editor.getTalendEditor().getAdapter(CommandStack.class);
    commandStack.addCommandStackEventListener(commandStackEventListener);
    if (!isReadOnly()) {
      getUpdateManager().updateAll();
    }
    IEclipsePreferences projectPreferences=(IEclipsePreferences)Log4jPrefsSettingManager.getInstance().getLog4jPreferences(Log4jPrefsConstants.LOG4J_ENABLE_NODE,false);
    projectPreferences.addPreferenceChangeListener(preferenceEventListener);
  }
}
Program: 119409
Project: 119409
Buggy source:
@Override public void undo(){
  Process process=(Process)connectionList.get(0).getSource().getProcess();
  for (  Connection connection : connectionList) {
    collpseJoblet(connection);
    connection.reconnect();
{
    }
    INodeConnector nodeConnectorSource, nodeConnectorTarget;
    nodeConnectorSource=connection.getSourceNodeConnector();
    if (nodeConnectorSource != null) {
      nodeConnectorSource.setCurLinkNbOutput(nodeConnectorSource.getCurLinkNbOutput() + 1);
    }
    nodeConnectorTarget=connection.getTargetNodeConnector();
    if (nodeConnectorTarget != null) {
      nodeConnectorTarget.setCurLinkNbInput(nodeConnectorTarget.getCurLinkNbInput() + 1);
    }
  }
  process.checkStartNodes();
  process.checkProcess();
}

Fixed version (ground truth):
@Override public void undo(){
  Process process=(Process)connectionList.get(0).getSource().getProcess();
  for (  Connection connection : connectionList) {
    collpseJoblet(connection);
    ConnectionDeletedInfo deletedInfo=connectionDeletedInfosMap.get(connection);
    if (deletedInfo != null) {
      INode source=connection.getSource();
      if (source != null && deletedInfo.metadataTable != null) {
        List<IMetadataTable> metaList=source.getMetadataList();
        if (!metaList.contains(deletedInfo.metadataTable)) {
          metaList.add(deletedInfo.metadataTableIndex,deletedInfo.metadataTable);
        }
      }
    }
    connection.reconnect();
    INode target=connection.getTarget();
    if (target.getExternalNode() instanceof AbstractNode) {
      ((AbstractNode)target.getExternalNode()).addInput(connection);
    }
    INodeConnector nodeConnectorSource, nodeConnectorTarget;
    nodeConnectorSource=connection.getSourceNodeConnector();
    if (nodeConnectorSource != null) {
      nodeConnectorSource.setCurLinkNbOutput(nodeConnectorSource.getCurLinkNbOutput() + 1);
    }
    nodeConnectorTarget=connection.getTargetNodeConnector();
    if (nodeConnectorTarget != null) {
      nodeConnectorTarget.setCurLinkNbInput(nodeConnectorTarget.getCurLinkNbInput() + 1);
    }
  }
  process.checkStartNodes();
  process.checkProcess();
}
Program: 119410
Project: 119410
Buggy source:
@Override public void execute(){
  Process process=(Process)connectionList.get(0).getSource().getProcess();
  for (  Connection connection : connectionList) {
    boolean re=deleteExpendNode(connection);
    if (re) {
      return;
    }
    connection.disconnect();
{
    }
    INodeConnector nodeConnectorSource, nodeConnectorTarget;
    nodeConnectorSource=connection.getSourceNodeConnector();
    if (nodeConnectorSource != null) {
      nodeConnectorSource.setCurLinkNbOutput(nodeConnectorSource.getCurLinkNbOutput() - 1);
    }
    nodeConnectorTarget=connection.getTargetNodeConnector();
    nodeConnectorTarget.setCurLinkNbInput(nodeConnectorTarget.getCurLinkNbInput() - 1);
  }
  process.checkStartNodes();
  process.checkProcess();
}

Fixed version (ground truth):
@Override public void execute(){
  connectionDeletedInfosMap=new HashMap<Connection,ConnectionDeleteCommand.ConnectionDeletedInfo>();
  Process process=(Process)connectionList.get(0).getSource().getProcess();
  for (  Connection connection : connectionList) {
    boolean re=deleteExpendNode(connection);
    if (re) {
      return;
    }
    ConnectionDeletedInfo deletedInfo=new ConnectionDeletedInfo();
    connectionDeletedInfosMap.put(connection,deletedInfo);
    INode source=connection.getSource();
    if (source != null) {
      deletedInfo.metadataTable=connection.getMetadataTable();
      List<IMetadataTable> metaList=source.getMetadataList();
      if (metaList != null && deletedInfo.metadataTable != null) {
        deletedInfo.metadataTableIndex=metaList.indexOf(deletedInfo.metadataTable);
      }
    }
    connection.disconnect();
    final INode target=connection.getTarget();
    if (target.getExternalNode() instanceof AbstractNode) {
      ((AbstractNode)target.getExternalNode()).removeInput(connection);
    }
    INodeConnector nodeConnectorSource, nodeConnectorTarget;
    nodeConnectorSource=connection.getSourceNodeConnector();
    if (nodeConnectorSource != null) {
      nodeConnectorSource.setCurLinkNbOutput(nodeConnectorSource.getCurLinkNbOutput() - 1);
    }
    nodeConnectorTarget=connection.getTargetNodeConnector();
    nodeConnectorTarget.setCurLinkNbInput(nodeConnectorTarget.getCurLinkNbInput() - 1);
  }
  process.checkStartNodes();
  process.checkProcess();
}
Program: 119416
Project: 119416
Buggy source:
private void initTestImportsType(){
  testImportsType=mock(IMPORTSType.class);
  IMPORTType importType1=mock(IMPORTType.class);
  importType1.setMODULE("String_Node_Str");
  importType1.setREQUIREDIF("String_Node_Str");
  testImportsType.getIMPORT().add(importType1);
  IMPORTType importType2=mock(IMPORTType.class);
  importType2.setMODULE("String_Node_Str");
  importType2.setREQUIREDIF("String_Node_Str");
  testImportsType.getIMPORT().add(importType2);
  IMPORTSType importsType=mock(IMPORTSType.class);
  importsType.setREQUIREDIF("String_Node_Str");
  IMPORTType importType3=mock(IMPORTType.class);
  importType3.setMODULE("String_Node_Str");
  importType3.setREQUIREDIF("String_Node_Str");
  importsType.getIMPORT().add(importType3);
  testImportsType.getIMPORTS().add(importsType);
}

Fixed version (ground truth):
private void initTestImportsType(){
  testImportsType=ComponentFactory.eINSTANCE.createIMPORTSType();
  IMPORTType importType1=ComponentFactory.eINSTANCE.createIMPORTType();
  importType1.setMODULE("String_Node_Str");
  importType1.setREQUIREDIF("String_Node_Str");
  testImportsType.getIMPORT().add(importType1);
  IMPORTType importType2=ComponentFactory.eINSTANCE.createIMPORTType();
  importType2.setMODULE("String_Node_Str");
  importType2.setREQUIREDIF("String_Node_Str");
  testImportsType.getIMPORT().add(importType2);
  IMPORTSType importsType=ComponentFactory.eINSTANCE.createIMPORTSType();
  importsType.setREQUIREDIF("String_Node_Str");
  IMPORTType importType3=ComponentFactory.eINSTANCE.createIMPORTType();
  importType3.setMODULE("String_Node_Str");
  importType3.setREQUIREDIF("String_Node_Str");
  importsType.getIMPORT().add(importType3);
  testImportsType.getIMPORTS().add(importsType);
}
Program: 119417
Project: 119417
Buggy source:
@Test public void testGetImportTypes(){
  List<IMPORTType> importTypes=manager.getImportTypes(testImportsType);
  assertNotNull(importTypes);
  assertTrue(importTypes.size() == 3);
  IMPORTType importType1=importTypes.get(0);
  assertEquals("String_Node_Str",importType1.getMODULE());
  assertEquals("String_Node_Str",importType1.getREQUIREDIF());
  IMPORTType importType2=importTypes.get(1);
  assertEquals("String_Node_Str",importType2.getMODULE());
  assertEquals("String_Node_Str",importType2.getREQUIREDIF());
  IMPORTType importType3=importTypes.get(2);
  assertEquals("String_Node_Str",importType3.getMODULE());
  assertEquals("String_Node_Str",importType3.getREQUIREDIF());
}

Fixed version (ground truth):
@Test public void testGetImportTypes(){
  manager=ImportModuleManager.getInstance();
  initTestImportsType();
  List<IMPORTType> importTypes=manager.getImportTypes(testImportsType);
  assertNotNull(importTypes);
  assertTrue(importTypes.size() == 3);
  IMPORTType importType1=importTypes.get(0);
  assertEquals("String_Node_Str",importType1.getMODULE());
  assertEquals("String_Node_Str",importType1.getREQUIREDIF());
  IMPORTType importType2=importTypes.get(1);
  assertEquals("String_Node_Str",importType2.getMODULE());
  assertEquals("String_Node_Str",importType2.getREQUIREDIF());
  IMPORTType importType3=importTypes.get(2);
  assertEquals("String_Node_Str",importType3.getMODULE());
  assertEquals("String_Node_Str",importType3.getREQUIREDIF());
}
Program: 119418
Project: 119418
Buggy source:
private void closeJob() throws AsyncApiException {
  JobInfo closeJob=new JobInfo();
  closeJob.setId(job.getId());
  closeJob.setState(JobStateEnum.Closed);
  connection.updateJob(closeJob);
}

Fixed version (ground truth):
private void closeJob() throws AsyncApiException, ConnectionException {
  JobInfo closeJob=new JobInfo();
  closeJob.setId(job.getId());
  closeJob.setState(JobStateEnum.Closed);
  connection.updateJob(closeJob);
}
Program: 119419
Project: 119419
Buggy source:
private JobInfo createJob() throws AsyncApiException {
  JobInfo job=new JobInfo();
  if (concurrencyMode != null) {
    job.setConcurrencyMode(concurrencyMode);
  }
  job.setObject(sObjectType);
  job.setOperation(operation);
  if (OperationEnum.upsert.equals(operation)) {
    job.setExternalIdFieldName(externalIdFieldName);
  }
  job.setContentType(contentType);
  job=connection.createJob(job);
  return job;
}

Fixed version (ground truth):
private JobInfo createJob() throws AsyncApiException, ConnectionException {
  JobInfo job=new JobInfo();
  if (concurrencyMode != null) {
    job.setConcurrencyMode(concurrencyMode);
  }
  job.setObject(sObjectType);
  job.setOperation(operation);
  if (OperationEnum.upsert.equals(operation)) {
    job.setExternalIdFieldName(externalIdFieldName);
  }
  job.setContentType(contentType);
  job=connection.createJob(job);
  return job;
}
Program: 119420
Project: 119420
Buggy source:
public void doBulkQuery(String moduleName,String queryStatement,int secToWait) throws AsyncApiException, InterruptedException {
  job=new JobInfo();
  job.setObject(moduleName);
  job.setOperation(OperationEnum.query);
  if (concurrencyMode != null) {
    job.setConcurrencyMode(concurrencyMode);
  }
  job.setContentType(ContentType.CSV);
  job=connection.createJob(job);
  job=connection.getJobStatus(job.getId());
  batchInfoList=new ArrayList<BatchInfo>();
  BatchInfo info=null;
  ByteArrayInputStream bout=new ByteArrayInputStream(queryStatement.getBytes());
  info=connection.createBatchFromStream(job,bout);
  while (true) {
    Thread.sleep(secToWait * 1000);
    info=connection.getBatchInfo(job.getId(),info.getId());
    if (info.getState() == BatchStateEnum.Completed) {
      QueryResultList list=connection.getQueryResultList(job.getId(),info.getId());
      queryResultIDs=list.getResult();
      break;
    }
 else     if (info.getState() == BatchStateEnum.Failed) {
      throw new RuntimeException("String_Node_Str" + info);
    }
 else {
      System.out.println("String_Node_Str" + info);
    }
  }
  batchInfoList.add(info);
  closeJob();
}

Fixed version (ground truth):
public void doBulkQuery(String moduleName,String queryStatement,int secToWait) throws AsyncApiException, InterruptedException, ConnectionException {
  job=new JobInfo();
  job.setObject(moduleName);
  job.setOperation(OperationEnum.query);
  if (concurrencyMode != null) {
    job.setConcurrencyMode(concurrencyMode);
  }
  job.setContentType(ContentType.CSV);
  job=connection.createJob(job);
  job=connection.getJobStatus(job.getId());
  batchInfoList=new ArrayList<BatchInfo>();
  BatchInfo info=null;
  ByteArrayInputStream bout=new ByteArrayInputStream(queryStatement.getBytes());
  info=connection.createBatchFromStream(job,bout);
  while (true) {
    Thread.sleep(secToWait * 1000);
    info=connection.getBatchInfo(job.getId(),info.getId());
    if (info.getState() == BatchStateEnum.Completed) {
      QueryResultList list=connection.getQueryResultList(job.getId(),info.getId());
      queryResultIDs=list.getResult();
      break;
    }
 else     if (info.getState() == BatchStateEnum.Failed) {
      throw new RuntimeException("String_Node_Str" + info);
    }
 else {
      System.out.println("String_Node_Str" + info);
    }
  }
  batchInfoList.add(info);
  closeJob();
}
Program: 119421
Project: 119421
Buggy source:
public InputStream getQueryResultStream(String resultId) throws AsyncApiException, IOException {
  return connection.getQueryResultStream(job.getId(),batchInfoList.get(0).getId(),resultId);
}

Fixed version (ground truth):
public InputStream getQueryResultStream(String resultId) throws AsyncApiException, IOException, ConnectionException {
  return connection.getQueryResultStream(job.getId(),batchInfoList.get(0).getId(),resultId);
}
Program: 119423
Project: 119423
Buggy source:
public List<Map<String,String>> getQueryResult(String resultId) throws AsyncApiException, IOException {
  List<Map<String,String>> resultInfoList=new ArrayList<Map<String,String>>();
  Map<String,String> resultInfo;
  baseFileReader=new com.talend.csv.CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(connection.getQueryResultStream(job.getId(),batchInfoList.get(0).getId(),resultId),FILE_ENCODING)),',');
  if (baseFileReader.readNext()) {
    baseFileHeader=Arrays.asList(baseFileReader.getValues());
  }
  baseFileHeaderSize=baseFileHeader.size();
  String[] row;
  while (baseFileReader.readNext()) {
    if ((row=baseFileReader.getValues()) != null) {
      resultInfo=new HashMap<String,String>();
      for (int i=0; i < baseFileHeaderSize; i++) {
        resultInfo.put(baseFileHeader.get(i),row[i]);
      }
      resultInfoList.add(resultInfo);
    }
  }
  closeFileRead();
  return resultInfoList;
}

Fixed version (ground truth):
public List<Map<String,String>> getQueryResult(String resultId) throws AsyncApiException, IOException, ConnectionException {
  List<Map<String,String>> resultInfoList=new ArrayList<Map<String,String>>();
  Map<String,String> resultInfo;
  baseFileReader=new com.talend.csv.CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(connection.getQueryResultStream(job.getId(),batchInfoList.get(0).getId(),resultId),FILE_ENCODING)),',');
  if (baseFileReader.readNext()) {
    baseFileHeader=Arrays.asList(baseFileReader.getValues());
  }
  baseFileHeaderSize=baseFileHeader.size();
  String[] row;
  while (baseFileReader.readNext()) {
    if ((row=baseFileReader.getValues()) != null) {
      resultInfo=new HashMap<String,String>();
      for (int i=0; i < baseFileHeaderSize; i++) {
        resultInfo.put(baseFileHeader.get(i),row[i]);
      }
      resultInfoList.add(resultInfo);
    }
  }
  closeFileRead();
  return resultInfoList;
}
Program: 119424
Project: 119424
Buggy source:
private void createBatch(FileOutputStream tmpOut,File tmpFile,List<BatchInfo> batchInfos) throws IOException, AsyncApiException {
  tmpOut.flush();
  tmpOut.close();
  FileInputStream tmpInputStream=new FileInputStream(tmpFile);
  try {
    BatchInfo batchInfo=connection.createBatchFromStream(job,tmpInputStream);
    batchInfos.add(batchInfo);
  }
  finally {
    tmpInputStream.close();
  }
}

Fixed version (ground truth):
private void createBatch(FileOutputStream tmpOut,File tmpFile,List<BatchInfo> batchInfos) throws IOException, AsyncApiException, ConnectionException {
  tmpOut.flush();
  tmpOut.close();
  FileInputStream tmpInputStream=new FileInputStream(tmpFile);
  try {
    BatchInfo batchInfo=connection.createBatchFromStream(job,tmpInputStream);
    batchInfos.add(batchInfo);
  }
  finally {
    tmpInputStream.close();
  }
}
Program: 119425
Project: 119425
Buggy source:
private void awaitCompletion() throws AsyncApiException {
  long sleepTime=0L;
  Set<String> incomplete=new HashSet<String>();
  for (  BatchInfo bi : batchInfoList) {
    incomplete.add(bi.getId());
  }
  while (!incomplete.isEmpty()) {
    try {
      Thread.sleep(sleepTime);
    }
 catch (    InterruptedException e) {
    }
    sleepTime=awaitTime;
    BatchInfo[] statusList=connection.getBatchInfoList(job.getId()).getBatchInfo();
    for (    BatchInfo b : statusList) {
      if (b.getState() == BatchStateEnum.Completed || b.getState() == BatchStateEnum.Failed) {
        incomplete.remove(b.getId());
      }
    }
  }
}

Fixed version (ground truth):
private void awaitCompletion() throws AsyncApiException, ConnectionException {
  long sleepTime=0L;
  Set<String> incomplete=new HashSet<String>();
  for (  BatchInfo bi : batchInfoList) {
    incomplete.add(bi.getId());
  }
  while (!incomplete.isEmpty()) {
    try {
      Thread.sleep(sleepTime);
    }
 catch (    InterruptedException e) {
    }
    sleepTime=awaitTime;
    BatchInfo[] statusList=connection.getBatchInfoList(job.getId()).getBatchInfo();
    for (    BatchInfo b : statusList) {
      if (b.getState() == BatchStateEnum.Completed || b.getState() == BatchStateEnum.Failed) {
        incomplete.remove(b.getId());
      }
    }
  }
}
Program: 119426
Project: 119426
Buggy source:
public List<Map<String,String>> getBatchLog(int batchNum) throws AsyncApiException, IOException {
  List<Map<String,String>> resultInfoList=new ArrayList<Map<String,String>>();
  Map<String,String> resultInfo;
  BatchInfo b=batchInfoList.get(batchNum);
  CSVReader rdr=new CSVReader(connection.getBatchResultStream(job.getId(),b.getId()));
  List<String> resultHeader=rdr.nextRecord();
  int resultCols=resultHeader.size();
  List<String> row;
  while ((row=rdr.nextRecord()) != null) {
    resultInfo=new HashMap<String,String>();
    resultInfo.putAll(getBaseFileRow());
    for (int i=0; i < resultCols; i++) {
      resultInfo.put(resultHeader.get(i),row.get(i));
    }
    resultInfoList.add(resultInfo);
  }
  return resultInfoList;
}

Fixed version (ground truth):
public List<Map<String,String>> getBatchLog(int batchNum) throws AsyncApiException, IOException, ConnectionException {
  List<Map<String,String>> resultInfoList=new ArrayList<Map<String,String>>();
  Map<String,String> resultInfo;
  BatchInfo b=batchInfoList.get(batchNum);
  CSVReader rdr=new CSVReader(connection.getBatchResultStream(job.getId(),b.getId()));
  List<String> resultHeader=rdr.nextRecord();
  int resultCols=resultHeader.size();
  List<String> row;
  while ((row=rdr.nextRecord()) != null) {
    resultInfo=new HashMap<String,String>();
    resultInfo.putAll(getBaseFileRow());
    for (int i=0; i < resultCols; i++) {
      resultInfo.put(resultHeader.get(i),row.get(i));
    }
    resultInfoList.add(resultInfo);
  }
  return resultInfoList;
}
Program: 119431
Project: 119431
Buggy source:
@Override public void dispose(){
  super.dispose();
  IRepositoryService service=DesignerPlugin.getDefault().getRepositoryService();
  IProxyRepositoryFactory repFactory=service.getProxyRepositoryFactory();
  try {
    item.getProperty().eAdapters().remove(dirtyListener);
    repFactory.unlock(item);
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
catch (  LoginException e) {
    ExceptionHandler.process(e);
  }
  if (!isEditable) {
    rEditorInput.getFile().setReadOnly(false);
  }
  IWorkbenchWindow activeWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  if (activeWorkbenchWindow != null) {
    IWorkbenchPage activePage=activeWorkbenchWindow.getActivePage();
    if (activePage != null) {
      IViewPart findView=activePage.findView(IJobSettingsView.ID);
      if (findView != null) {
        IJobSettingsView jobsetting=(IJobSettingsView)findView;
        if (!jobsetting.isCleaned()) {
          jobsetting.cleanDisplay();
        }
      }
    }
  }
  if (bgColorForReadOnlyItem != null) {
    bgColorForReadOnlyItem.dispose();
  }
  if (bgColorForEditabeItem != null) {
    bgColorForEditabeItem.dispose();
  }
}

Fixed version (ground truth):
@Override public void dispose(){
  super.dispose();
  IRepositoryService service=DesignerPlugin.getDefault().getRepositoryService();
  IProxyRepositoryFactory repFactory=service.getProxyRepositoryFactory();
  try {
    item.getProperty().eAdapters().remove(dirtyListener);
    repFactory.unlock(item);
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
catch (  LoginException e) {
    ExceptionHandler.process(e);
  }
  if (!isEditable) {
    rEditorInput.getFile().setReadOnly(false);
  }
  if (bgColorForReadOnlyItem != null) {
    bgColorForReadOnlyItem.dispose();
  }
  if (bgColorForEditabeItem != null) {
    bgColorForEditabeItem.dispose();
  }
}
Program: 119434
Project: 119434
Buggy source:
protected void removeTempDemoProject() throws PersistenceException, CoreException {
  ProjectManager.getInstance().getFolders(tempDemoProject.getEmfProject()).clear();
  final IProject project=ResourceModelUtils.getProject(tempDemoProject);
  project.delete(true,null);
}

Fixed version (ground truth):
protected void removeTempDemoProject() throws PersistenceException, CoreException {
  if (tempDemoProject != null) {
    ProjectManager.getInstance().getFolders(tempDemoProject.getEmfProject()).clear();
    final IProject project=ResourceModelUtils.getProject(tempDemoProject);
    project.delete(true,null);
  }
}
Program: 119435
Project: 119435
Buggy source:
@Test public void testMdmCeDemoImportComplete() throws Exception {
  Assert.assertNull(currentDemo);
}

Fixed version (ground truth):
@Test @Ignore public void testMdmCeDemoImportComplete() throws Exception {
  Assert.assertNull(currentDemo);
}
Program: 119445
Project: 119445
Buggy source:
/** 
 * Changed by Marvin Wang on Feb.22 for bug TDI-19166.
 * @throws Exception
 */
@BeforeClass public static void setUpBeforeClass() throws Exception {
  ProxyRepositoryFactory repFactory=ProxyRepositoryFactory.getInstance();
  repFactory.setRepositoryFactoryFromProvider(LocalRepositoryFactory.getInstance());
  Context ctx=CoreRuntimePlugin.getInstance().getContext();
  if (ctx != null) {
    RepositoryContext repositoryContext=(RepositoryContext)ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
    ECodeLanguage language=ECodeLanguage.JAVA;
    if (repositoryContext == null) {
      repositoryContext=new RepositoryContext();
      Project projectInfor=ProjectHelper.createProject(getProjectName(language),"String_Node_Str",language,createUser());
      Project project;
      try {
        project=repFactory.createProject(projectInfor);
        repositoryContext.setFields(new HashMap<String,String>());
        repositoryContext.setProject(project);
        ctx.putProperty(Context.REPOSITORY_CONTEXT_KEY,repositoryContext);
      }
 catch (      PersistenceException e) {
        e.printStackTrace();
      }
    }
  }
  componentSource=ComponentsFactoryProvider.getInstance().get("String_Node_Str",ComponentCategory.CATEGORY_4_DI.getName());
  componentTarget=ComponentsFactoryProvider.getInstance().get("String_Node_Str",ComponentCategory.CATEGORY_4_DI.getName());
  sourceProcess=new Process(createProperty());
  targetProcess=new Process(createProperty());
  source=new Node(componentSource,sourceProcess);
  source.setLocation(new Point(1,10));
  target=new Node(componentTarget,targetProcess);
  target.setLocation(new Point(100,2));
  newTarget=new Node(componentTarget,targetProcess);
  newTarget.setLocation(new Point(150,200));
}

Fixed version (ground truth):
/** 
 * Changed by Marvin Wang on Feb.22 for bug TDI-19166.
 * @throws Exception
 */
@BeforeClass public static void setUpBeforeClass() throws Exception {
  componentSource=ComponentsFactoryProvider.getInstance().get("String_Node_Str",ComponentCategory.CATEGORY_4_DI.getName());
  componentTarget=ComponentsFactoryProvider.getInstance().get("String_Node_Str",ComponentCategory.CATEGORY_4_DI.getName());
  sourceProcess=new Process(createProperty());
  targetProcess=new Process(createProperty());
  source=new Node(componentSource,sourceProcess);
  source.setLocation(new Point(1,10));
  target=new Node(componentTarget,targetProcess);
  target.setLocation(new Point(100,2));
  newTarget=new Node(componentTarget,targetProcess);
  newTarget.setLocation(new Point(150,200));
}
Program: 119448
Project: 119448
Buggy source:
protected void initTempPro() throws PersistenceException, CoreException {
  createTempDemoProject(demoName);
  Context ctx=CoreRuntimePlugin.getInstance().getContext();
  RepositoryContext repositoryContext=(RepositoryContext)ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
  originalProject=repositoryContext.getProject();
  initDQStructure();
  repositoryContext.setProject(tempDemoProject);
}

Fixed version (ground truth):
protected void initTempPro() throws PersistenceException, CoreException, LoginException {
  createTempDemoProject(demoName);
  Context ctx=CoreRuntimePlugin.getInstance().getContext();
  RepositoryContext repositoryContext=(RepositoryContext)ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
  originalProject=repositoryContext.getProject();
  ProxyRepositoryFactory.getInstance().logOnProject(tempDemoProject,new NullProgressMonitor());
  initDQStructure();
  repositoryContext.setProject(tempDemoProject);
}
Program: 119471
Project: 119471
Buggy source:
/** 
 * DOC YeXiaowei Comment method "isVirtualNode".
 * @param node
 * @return
 */
private boolean isVirtualNode(final INode node){
  boolean isVirtualNode=false;
  IElementParameter param=node.getElementParameter("String_Node_Str");
  if (param != null) {
    return (Boolean)param.getValue();
  }
  if (node.getUniqueName().startsWith("String_Node_Str")) {
    isVirtualNode=CorePlugin.getDefault().getMapperService().isVirtualComponent(node);
  }
 else   if (node.getUniqueName().startsWith("String_Node_Str")) {
    isVirtualNode=CorePlugin.getDefault().getXMLMapperService().isVirtualComponent(node);
  }
 else {
    List<IMultipleComponentManager> multipleComponentManagers=node.getComponent().getMultipleComponentManagers();
    for (    IMultipleComponentManager mcm : multipleComponentManagers) {
      if (!mcm.isLookupMode()) {
        return true;
      }
    }
  }
  return isVirtualNode;
}

Fixed version (ground truth):
/** 
 * DOC YeXiaowei Comment method "isVirtualNode".
 * @param node
 * @return
 */
private boolean isVirtualNode(final INode node){
  boolean isVirtualNode=false;
  IElementParameter param=node.getElementParameter("String_Node_Str");
  if (param != null) {
    return (Boolean)param.getValue();
  }
  if (node.getUniqueName().startsWith("String_Node_Str")) {
    isVirtualNode=CorePlugin.getDefault().getMapperService().isVirtualComponent(node);
  }
 else   if (node.getUniqueName().startsWith("String_Node_Str")) {
    isVirtualNode=CorePlugin.getDefault().getXMLMapperService().isVirtualComponent(node);
  }
 else   if (node.getUniqueName().startsWith("String_Node_Str")) {
    isVirtualNode=CorePlugin.getDefault().getHMapperService().isVirtualComponent(node);
  }
 else {
    List<IMultipleComponentManager> multipleComponentManagers=node.getComponent().getMultipleComponentManagers();
    for (    IMultipleComponentManager mcm : multipleComponentManagers) {
      if (!mcm.isLookupMode()) {
        return true;
      }
    }
  }
  return isVirtualNode;
}
Program: 119482
Project: 119482
Buggy source:
@Override public boolean getEnabledState(){
  if (model != null && (model.getElemParameter().getName().equals("String_Node_Str") || model.getElemParameter().getName().equals("String_Node_Str"))) {
    if (getExtendedTableViewer().getTable().getSelectionIndex() > -1) {
      TableItem item=extendedTableViewer.getTable().getSelection()[0];
      HashMap<String,String> itemMap=(HashMap<String,String>)item.getData();
      List<HashMap<String,String>> parameterValue=(List<HashMap<String,String>>)model.getElemParameter().getValue();
      for (      HashMap<String,String> parameterValueMap : parameterValue) {
        if (parameterValueMap.get("String_Node_Str").equals(itemMap.get("String_Node_Str")) && parameterValueMap.get("String_Node_Str").equals(itemMap.get("String_Node_Str"))) {
          if (parameterValueMap.get("String_Node_Str") != null && parameterValueMap.get("String_Node_Str").equals("String_Node_Str")) {
            return true;
          }
        }
      }
    }
  }
  return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
}

Fixed version (ground truth):
@Override public boolean getEnabledState(){
  if (model != null && (model.getElemParameter().getName().equals("String_Node_Str") || model.getElemParameter().getName().equals("String_Node_Str"))) {
    if (getExtendedTableViewer().getTable().getSelectionIndex() > -1) {
      TableItem item=extendedTableViewer.getTable().getSelection()[0];
      HashMap<String,String> itemMap=(HashMap<String,String>)item.getData();
      List<HashMap<String,String>> parameterValue=(List<HashMap<String,String>>)model.getElemParameter().getValue();
      for (      HashMap<String,String> parameterValueMap : parameterValue) {
        if (parameterValueMap != null && itemMap != null && parameterValueMap.get("String_Node_Str") != null && itemMap.get("String_Node_Str") != null) {
          if (parameterValueMap.get("String_Node_Str").equals(itemMap.get("String_Node_Str")) && parameterValueMap.get("String_Node_Str").equals(itemMap.get("String_Node_Str"))) {
            if (parameterValueMap.get("String_Node_Str") != null && parameterValueMap.get("String_Node_Str").equals("String_Node_Str")) {
              return true;
            }
          }
        }
      }
    }
  }
  return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
}
Program: 119483
Project: 119483
Buggy source:
@Override protected RemovePushButton createRemovePushButton(){
  RemovePushButtonForExtendedTable removePushButton=new RemovePushButtonForExtendedTable(this.toolbar,getExtendedTableViewer()){
    @Override public boolean getEnabledState(){
      if (model != null && (model.getElemParameter().getName().equals("String_Node_Str") || model.getElemParameter().getName().equals("String_Node_Str"))) {
        if (getExtendedTableViewer().getTable().getSelectionIndex() > -1) {
          TableItem item=extendedTableViewer.getTable().getSelection()[0];
          HashMap<String,String> itemMap=(HashMap<String,String>)item.getData();
          List<HashMap<String,String>> parameterValue=(List<HashMap<String,String>>)model.getElemParameter().getValue();
          for (          HashMap<String,String> parameterValueMap : parameterValue) {
            if (parameterValueMap.get("String_Node_Str").equals(itemMap.get("String_Node_Str")) && parameterValueMap.get("String_Node_Str").equals(itemMap.get("String_Node_Str"))) {
              if (parameterValueMap.get("String_Node_Str") != null && parameterValueMap.get("String_Node_Str").equals("String_Node_Str")) {
                return true;
              }
            }
          }
        }
      }
      return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
    }
  }
;
  removePushButton.addListener(getPropertyChangeListener(),false);
  return removePushButton;
}

Fixed version (ground truth):
@Override protected RemovePushButton createRemovePushButton(){
  RemovePushButtonForExtendedTable removePushButton=new RemovePushButtonForExtendedTable(this.toolbar,getExtendedTableViewer()){
    @Override public boolean getEnabledState(){
      if (model != null && (model.getElemParameter().getName().equals("String_Node_Str") || model.getElemParameter().getName().equals("String_Node_Str"))) {
        if (getExtendedTableViewer().getTable().getSelectionIndex() > -1) {
          TableItem item=extendedTableViewer.getTable().getSelection()[0];
          HashMap<String,String> itemMap=(HashMap<String,String>)item.getData();
          List<HashMap<String,String>> parameterValue=(List<HashMap<String,String>>)model.getElemParameter().getValue();
          for (          HashMap<String,String> parameterValueMap : parameterValue) {
            if (parameterValueMap != null && itemMap != null && parameterValueMap.get("String_Node_Str") != null && itemMap.get("String_Node_Str") != null) {
              if (parameterValueMap.get("String_Node_Str").equals(itemMap.get("String_Node_Str")) && parameterValueMap.get("String_Node_Str").equals(itemMap.get("String_Node_Str"))) {
                if (parameterValueMap.get("String_Node_Str") != null && parameterValueMap.get("String_Node_Str").equals("String_Node_Str")) {
                  return true;
                }
              }
            }
          }
        }
      }
      return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
    }
  }
;
  removePushButton.addListener(getPropertyChangeListener(),false);
  return removePushButton;
}
Program: 119485
Project: 119485
Buggy source:
@Override public void run(IProgressMonitor monitor){
  TreeItem root=xmlViewer.getTree().getItem(0);
  List<HL7TreeNode> mappableNodes=new ArrayList<HL7TreeNode>();
  if (getManager().getHl7Component().isHL7Output()) {
    if (getManager() instanceof HL7OutputManager) {
      mappableNodes=((HL7OutputManager)getManager()).getTreeData("String_Node_Str");
      createLoopLinks(mappableNodes);
      xmlViewer.refresh();
      getBackgroundRefresher().refreshBackground();
    }
  }
 else {
    List<TreeItem> allItems=TreeUtils.collectAllItems(root);
    monitorWrap=SubMonitor.convert(monitor);
    String taskName=Messages.getString("String_Node_Str");
    int totalWork=allItems.size();
    monitorWrap.beginTask(taskName,totalWork);
    for (int i=0; i < totalWork; i++) {
      if (monitorWrap.isCanceled()) {
        return;
      }
      TreeItem treeItem=allItems.get(i);
      HL7TreeNode node=(HL7TreeNode)treeItem.getData();
      if (node.getColumn() == null) {
        continue;
      }
      createLoopLinks(node.getColumn().getLabel(),treeItem,monitorWrap,i == totalWork - 1);
      monitorWrap.worked(1);
    }
    monitorWrap.done();
  }
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor){
  TreeItem root=xmlViewer.getTree().getItem(0);
  List<HL7TreeNode> mappableNodes=new ArrayList<HL7TreeNode>();
  if (getManager().getHl7Component().isHL7Output()) {
    if (getManager() instanceof HL7OutputManager) {
      mappableNodes=((HL7OutputManager)getManager()).getTreeData("String_Node_Str");
      createLoopLinks(mappableNodes);
      xmlViewer.refresh();
      getBackgroundRefresher().refreshBackground();
    }
  }
 else {
    List<TreeItem> allItems=TreeUtils.collectAllItems(root);
    monitorWrap=new EventLoopProgressMonitor(monitor);
    String taskName=Messages.getString("String_Node_Str");
    int totalWork=allItems.size();
    monitorWrap.beginTask(taskName,totalWork);
    for (int i=0; i < totalWork; i++) {
      if (monitorWrap.isCanceled()) {
        return;
      }
      TreeItem treeItem=allItems.get(i);
      HL7TreeNode node=(HL7TreeNode)treeItem.getData();
      if (node.getColumn() == null) {
        continue;
      }
      createLoopLinks(node.getColumn().getLabel(),treeItem,monitorWrap,i == totalWork - 1);
      monitorWrap.worked(1);
    }
    monitorWrap.done();
  }
}
Program: 119488
Project: 119488
Buggy source:
@Override public void run(IProgressMonitor monitor){
  monitorWrap=SubMonitor.convert(monitor);
  List<SchemaTarget> addedObjects=new ArrayList<SchemaTarget>(event.addedObjects);
  JSONToXPathLinker.this.createFieldsLinkWithProgressMonitor(monitorWrap,addedObjects.size(),addedObjects,event.index,addedObjects.size());
  monitorWrap.done();
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor){
  monitorWrap=new EventLoopProgressMonitor(monitor);
  List<SchemaTarget> addedObjects=new ArrayList<SchemaTarget>(event.addedObjects);
  JSONToXPathLinker.this.createFieldsLinkWithProgressMonitor(monitorWrap,addedObjects.size(),addedObjects,event.index,addedObjects.size());
  monitorWrap.done();
}