nus-yam/ex-repair huggingface dataset:
Program: 129717
Project: 129717
Buggy source:
/** 
 * @return the modulesNeededPerJob
 */
public Set<String> getModulesNeededPerJob(String jobId,String jobVersion){
  String key=jobId + "String_Node_Str" + jobVersion;
  if (!modulesNeededPerJob.containsKey(key)) {
    modulesNeededPerJob.put(key,new HashSet<String>());
  }
  return modulesNeededPerJob.get(key);
}

Fixed version (ground truth):
/** 
 * @return the modulesNeededPerJob
 */
public Set<ModuleNeeded> getModulesNeededPerJob(String jobId,String jobVersion){
  String key=jobId + "String_Node_Str" + jobVersion;
  if (!modulesNeededPerJob.containsKey(key)) {
    modulesNeededPerJob.put(key,new HashSet<ModuleNeeded>());
  }
  return modulesNeededPerJob.get(key);
}
Program: 129718
Project: 129718
Buggy source:
private LastGenerationInfo(){
  modulesNeededPerJob=new HashMap<String,Set<String>>();
  contextPerJob=new HashMap<String,Set<String>>();
  modulesNeededWithSubjobPerJob=new HashMap<String,Set<String>>();
  lastGeneratedjobs=new HashSet<JobInfo>();
  routinesNeededPerJob=new HashMap<String,Set<String>>();
  routinesNeededWithSubjobPerJob=new HashMap<String,Set<String>>();
  useDynamic=new HashMap<String,Boolean>();
}

Fixed version (ground truth):
private LastGenerationInfo(){
  modulesNeededPerJob=new HashMap<String,Set<ModuleNeeded>>();
  contextPerJob=new HashMap<String,Set<String>>();
  modulesNeededWithSubjobPerJob=new HashMap<String,Set<ModuleNeeded>>();
  lastGeneratedjobs=new HashSet<JobInfo>();
  routinesNeededPerJob=new HashMap<String,Set<String>>();
  routinesNeededWithSubjobPerJob=new HashMap<String,Set<String>>();
  useDynamic=new HashMap<String,Boolean>();
}
Program: 129719
Project: 129719
Buggy source:
/** 
 * Sets the modulesNeededPerJob.
 * @param modulesNeededPerJob the modulesNeededPerJob to set
 */
public void setModulesNeededPerJob(String jobId,String jobVersion,Set<String> modulesNeeded){
  String key=jobId + "String_Node_Str" + jobVersion;
  modulesNeededPerJob.put(key,new HashSet<String>(modulesNeeded));
}

Fixed version (ground truth):
/** 
 * Sets the modulesNeededPerJob.
 * @param modulesNeededPerJob the modulesNeededPerJob to set
 */
public void setModulesNeededPerJob(String jobId,String jobVersion,Set<ModuleNeeded> modulesNeeded){
  String key=jobId + "String_Node_Str" + jobVersion;
  modulesNeededPerJob.put(key,new HashSet<ModuleNeeded>(modulesNeeded));
}
Program: 129720
Project: 129720
Buggy source:
/** 
 * @return the modulesNeededPerJob
 */
public Set<String> getModulesNeededWithSubjobPerJob(String jobId,String jobVersion){
  String key=jobId + "String_Node_Str" + jobVersion;
  if (!modulesNeededWithSubjobPerJob.containsKey(key)) {
    modulesNeededWithSubjobPerJob.put(key,new HashSet<String>());
  }
  return modulesNeededWithSubjobPerJob.get(key);
}

Fixed version (ground truth):
/** 
 * @return the modulesNeededPerJob
 */
public Set<ModuleNeeded> getModulesNeededWithSubjobPerJob(String jobId,String jobVersion){
  String key=jobId + "String_Node_Str" + jobVersion;
  if (!modulesNeededWithSubjobPerJob.containsKey(key)) {
    modulesNeededWithSubjobPerJob.put(key,new HashSet<ModuleNeeded>());
  }
  return modulesNeededWithSubjobPerJob.get(key);
}
Program: 129721
Project: 129721
Buggy source:
/** 
 * Sets the modulesNeededWithSubjobPerJob.
 * @param modulesNeededWithSubjobPerJob the modulesNeededWithSubjobPerJob to set
 */
public void setModulesNeededWithSubjobPerJob(String jobId,String jobVersion,Set<String> modulesNeeded){
  String key=jobId + "String_Node_Str" + jobVersion;
  if (modulesNeeded == null) {
    modulesNeededWithSubjobPerJob.put(key,null);
  }
 else {
    modulesNeededWithSubjobPerJob.put(key,new HashSet<String>(modulesNeeded));
  }
}

Fixed version (ground truth):
/** 
 * Sets the modulesNeededWithSubjobPerJob.
 * @param modulesNeededWithSubjobPerJob the modulesNeededWithSubjobPerJob to set
 */
public void setModulesNeededWithSubjobPerJob(String jobId,String jobVersion,Set<ModuleNeeded> modulesNeeded){
  String key=jobId + "String_Node_Str" + jobVersion;
  if (modulesNeeded == null) {
    modulesNeededWithSubjobPerJob.put(key,null);
  }
 else {
    modulesNeededWithSubjobPerJob.put(key,new HashSet<ModuleNeeded>(modulesNeeded));
  }
}
Program: 129722
Project: 129722
Buggy source:
private static void generateBuildInfo(JobInfo jobInfo,IProgressMonitor progressMonitor,boolean isMainJob,IProcess currentProcess,String currentJobName) throws ProcessorException {
  if (isMainJob) {
    progressMonitor.subTask(Messages.getString("String_Node_Str") + currentJobName);
    CorePlugin.getDefault().getRunProcessService().updateLibraries(LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion()),currentProcess);
    if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA && codeModified) {
      try {
        ((IJavaProject)CorePlugin.getDefault().getRunProcessService().getJavaProject()).getProject().build(IncrementalProjectBuilder.AUTO_BUILD,null);
      }
 catch (      CoreException e) {
        throw new ProcessorException(e);
      }
    }
    codeModified=false;
  }
}

Fixed version (ground truth):
private static void generateBuildInfo(JobInfo jobInfo,IProgressMonitor progressMonitor,boolean isMainJob,IProcess currentProcess,String currentJobName) throws ProcessorException {
  if (isMainJob) {
    progressMonitor.subTask(Messages.getString("String_Node_Str") + currentJobName);
    Set<String> jarList=new HashSet<String>();
    Set<ModuleNeeded> neededModules=LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion());
    for (    ModuleNeeded module : neededModules) {
      jarList.add(module.getModuleName());
    }
    CorePlugin.getDefault().getRunProcessService().updateLibraries(jarList,currentProcess);
    if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA && codeModified) {
      try {
        ((IJavaProject)CorePlugin.getDefault().getRunProcessService().getJavaProject()).getProject().build(IncrementalProjectBuilder.AUTO_BUILD,null);
      }
 catch (      CoreException e) {
        throw new ProcessorException(e);
      }
    }
    codeModified=false;
  }
}
Program: 129723
Project: 129723
Buggy source:
public void run(){
  orgomg.cwm.objectmodel.core.Package pack=(orgomg.cwm.objectmodel.core.Package)existTable.eContainer();
  boolean confirm=MessageDialog.openConfirm(Display.getDefault().getActiveShell(),"String_Node_Str","String_Node_Str" + existTable.getLabel() + "String_Node_Str"+ pack.getName()+ "String_Node_Str");
  if (confirm) {
    TreeItem existItem=getExistItem(existTable);
    TableNode existTableItem=getExistCheckedTable((TableNode)item.getData());
    if (existItem == null) {
      if (existTableItem == null) {
        return;
      }
 else {
        clearTableItem(existTableItem,true);
      }
    }
 else {
      clearTableItem(existItem);
      existItem.setChecked(false);
    }
    item.setText(3,Messages.getString("String_Node_Str"));
    countPending++;
    parentWizardPage.setPageComplete(false);
    refreshTable(item,-1);
  }
 else {
    item.setChecked(false);
    boolean hasCheckedItem=false;
    TreeItem parentItem=item.getParentItem();
    if (parentItem != null) {
      for (      TreeItem i : parentItem.getItems()) {
        if (i.getChecked()) {
          hasCheckedItem=true;
          break;
        }
      }
    }
    if (!hasCheckedItem) {
      parentItem.setChecked(false);
    }
  }
}

Fixed version (ground truth):
public void run(){
  orgomg.cwm.objectmodel.core.Package pack=(orgomg.cwm.objectmodel.core.Package)existTable.eContainer();
  boolean confirm=MessageDialog.openConfirm(Display.getDefault().getActiveShell(),"String_Node_Str","String_Node_Str" + existTable.getLabel() + "String_Node_Str"+ pack.getName()+ "String_Node_Str");
  if (confirm) {
    TreeItem existItem=getExistItem(existTable);
    TableNode existTableItem=getExistCheckedTable((TableNode)item.getData());
    if (existItem == null) {
      if (existTableItem == null) {
        return;
      }
 else {
        clearTableItem(existTableItem,true);
      }
    }
 else {
      clearTableItem(existItem);
      existItem.setChecked(false);
    }
    item.setText(3,Messages.getString("String_Node_Str"));
    countPending++;
    parentWizardPage.setPageComplete(false);
    refreshTable(item,-1);
  }
 else {
    item.setChecked(false);
    boolean hasCheckedItem=false;
    TreeItem parentItem=item.getParentItem();
    if (parentItem != null) {
      for (      TreeItem i : parentItem.getItems()) {
        if (i.getChecked()) {
          hasCheckedItem=true;
          break;
        }
      }
    }
    if (!hasCheckedItem && parentItem != null) {
      parentItem.setChecked(false);
    }
  }
}
Program: 129724
Project: 129724
Buggy source:
private void refreshExistItem(final MetadataTable existTable,final TreeItem item){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      orgomg.cwm.objectmodel.core.Package pack=(orgomg.cwm.objectmodel.core.Package)existTable.eContainer();
      boolean confirm=MessageDialog.openConfirm(Display.getDefault().getActiveShell(),"String_Node_Str","String_Node_Str" + existTable.getLabel() + "String_Node_Str"+ pack.getName()+ "String_Node_Str");
      if (confirm) {
        TreeItem existItem=getExistItem(existTable);
        TableNode existTableItem=getExistCheckedTable((TableNode)item.getData());
        if (existItem == null) {
          if (existTableItem == null) {
            return;
          }
 else {
            clearTableItem(existTableItem,true);
          }
        }
 else {
          clearTableItem(existItem);
          existItem.setChecked(false);
        }
        item.setText(3,Messages.getString("String_Node_Str"));
        countPending++;
        parentWizardPage.setPageComplete(false);
        refreshTable(item,-1);
      }
 else {
        item.setChecked(false);
        boolean hasCheckedItem=false;
        TreeItem parentItem=item.getParentItem();
        if (parentItem != null) {
          for (          TreeItem i : parentItem.getItems()) {
            if (i.getChecked()) {
              hasCheckedItem=true;
              break;
            }
          }
        }
        if (!hasCheckedItem) {
          parentItem.setChecked(false);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private void refreshExistItem(final MetadataTable existTable,final TreeItem item){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      orgomg.cwm.objectmodel.core.Package pack=(orgomg.cwm.objectmodel.core.Package)existTable.eContainer();
      boolean confirm=MessageDialog.openConfirm(Display.getDefault().getActiveShell(),"String_Node_Str","String_Node_Str" + existTable.getLabel() + "String_Node_Str"+ pack.getName()+ "String_Node_Str");
      if (confirm) {
        TreeItem existItem=getExistItem(existTable);
        TableNode existTableItem=getExistCheckedTable((TableNode)item.getData());
        if (existItem == null) {
          if (existTableItem == null) {
            return;
          }
 else {
            clearTableItem(existTableItem,true);
          }
        }
 else {
          clearTableItem(existItem);
          existItem.setChecked(false);
        }
        item.setText(3,Messages.getString("String_Node_Str"));
        countPending++;
        parentWizardPage.setPageComplete(false);
        refreshTable(item,-1);
      }
 else {
        item.setChecked(false);
        boolean hasCheckedItem=false;
        TreeItem parentItem=item.getParentItem();
        if (parentItem != null) {
          for (          TreeItem i : parentItem.getItems()) {
            if (i.getChecked()) {
              hasCheckedItem=true;
              break;
            }
          }
        }
        if (!hasCheckedItem && parentItem != null) {
          parentItem.setChecked(false);
        }
      }
    }
  }
);
}
Program: 129725
Project: 129725
Buggy source:
protected void deleteTable(TableNode tableItem){
  Collection<MetadataTable> tables=new ArrayList<MetadataTable>();
  Iterator<MetadataTable> iterate=ConnectionHelper.getTables(getConnection()).iterator();
  while (iterate.hasNext()) {
    MetadataTable metadata=iterate.next();
    if (metadata != null && metadata.getLabel().equals(tableItem.getValue())) {
      tables.add(metadata);
    }
  }
  TableNode parent=tableItem.getParent();
  String catalog="String_Node_Str";
  String schema="String_Node_Str";
  if (parent != null) {
    if (parent.getType() == TableNode.CATALOG) {
      catalog=parent.getValue();
    }
 else     if (parent.getType() == TableNode.SCHEMA) {
      schema=parent.getValue();
      TableNode catalogNode=parent.getParent();
      if (catalogNode != null) {
        catalog=catalogNode.getValue();
      }
    }
  }
  boolean isAccess=EDatabaseTypeName.ACCESS.getDisplayName().equals(metadataconnection.getDbType());
  if (isAccess) {
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,getConnection().getName(),getConnection(),tables);
  }
 else {
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,schema,getConnection(),tables);
  }
}

Fixed version (ground truth):
protected void deleteTable(TableNode tableItem){
  Collection<MetadataTable> tables=new ArrayList<MetadataTable>();
  Iterator<MetadataTable> iterate=ConnectionHelper.getTables(getConnection()).iterator();
  while (iterate.hasNext()) {
    MetadataTable metadata=iterate.next();
    if (metadata != null && metadata.getLabel().equals(tableItem.getValue())) {
      tables.add(metadata);
    }
  }
  TableNode parent=tableItem.getParent();
  String catalog="String_Node_Str";
  String schema="String_Node_Str";
  if (parent != null) {
    if (parent.getType() == TableNode.CATALOG) {
      catalog=parent.getValue();
    }
 else     if (parent.getType() == TableNode.SCHEMA) {
      schema=parent.getValue();
      TableNode catalogNode=parent.getParent();
      if (catalogNode != null) {
        catalog=catalogNode.getValue();
      }
    }
  }
  boolean isAccess=EDatabaseTypeName.ACCESS.getDisplayName().equals(metadataconnection.getDbType());
  if (isAccess) {
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,getConnection().getName(),getConnection(),tables);
  }
 else {
    if ("String_Node_Str".equals(schema) && ExtractMetaDataUtils.useAllSynonyms && EDatabaseTypeName.ORACLEFORSID.getDisplayName().equals(metadataconnection.getDbType())) {
      schema=MetadataConnectionUtils.FAKE_SCHEMA_SYNONYMS;
    }
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,schema,getConnection(),tables);
  }
}
Program: 129726
Project: 129726
Buggy source:
public void run(){
  orgomg.cwm.objectmodel.core.Package pack=(orgomg.cwm.objectmodel.core.Package)existTable.eContainer();
  boolean confirm=MessageDialog.openConfirm(Display.getDefault().getActiveShell(),"String_Node_Str","String_Node_Str" + existTable.getLabel() + "String_Node_Str"+ pack.getName()+ "String_Node_Str");
  if (confirm) {
    TreeItem existItem=getExistItem(existTable);
    TableNode existTableItem=getExistCheckedTable((TableNode)item.getData());
    if (existItem == null) {
      if (existTableItem == null) {
        return;
      }
 else {
        clearTableItem(existTableItem,true);
      }
    }
 else {
      clearTableItem(existItem);
      existItem.setChecked(false);
    }
    item.setText(3,Messages.getString("String_Node_Str"));
    countPending++;
    parentWizardPage.setPageComplete(false);
    refreshTable(item,-1);
  }
 else {
    item.setChecked(false);
    boolean hasCheckedItem=false;
    TreeItem parentItem=item.getParentItem();
    if (parentItem != null) {
      for (      TreeItem i : parentItem.getItems()) {
        if (i.getChecked()) {
          hasCheckedItem=true;
          break;
        }
      }
    }
    if (!hasCheckedItem) {
      parentItem.setChecked(false);
    }
  }
}

Fixed version (ground truth):
public void run(){
  orgomg.cwm.objectmodel.core.Package pack=(orgomg.cwm.objectmodel.core.Package)existTable.eContainer();
  boolean confirm=MessageDialog.openConfirm(Display.getDefault().getActiveShell(),"String_Node_Str","String_Node_Str" + existTable.getLabel() + "String_Node_Str"+ pack.getName()+ "String_Node_Str");
  if (confirm) {
    TreeItem existItem=getExistItem(existTable);
    TableNode existTableItem=getExistCheckedTable((TableNode)item.getData());
    if (existItem == null) {
      if (existTableItem == null) {
        return;
      }
 else {
        clearTableItem(existTableItem,true);
      }
    }
 else {
      clearTableItem(existItem);
      existItem.setChecked(false);
    }
    item.setText(3,Messages.getString("String_Node_Str"));
    countPending++;
    parentWizardPage.setPageComplete(false);
    refreshTable(item,-1);
  }
 else {
    item.setChecked(false);
    boolean hasCheckedItem=false;
    TreeItem parentItem=item.getParentItem();
    if (parentItem != null) {
      for (      TreeItem i : parentItem.getItems()) {
        if (i.getChecked()) {
          hasCheckedItem=true;
          break;
        }
      }
    }
    if (!hasCheckedItem && parentItem != null) {
      parentItem.setChecked(false);
    }
  }
}
Program: 129727
Project: 129727
Buggy source:
private void refreshExistItem(final MetadataTable existTable,final TreeItem item){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      orgomg.cwm.objectmodel.core.Package pack=(orgomg.cwm.objectmodel.core.Package)existTable.eContainer();
      boolean confirm=MessageDialog.openConfirm(Display.getDefault().getActiveShell(),"String_Node_Str","String_Node_Str" + existTable.getLabel() + "String_Node_Str"+ pack.getName()+ "String_Node_Str");
      if (confirm) {
        TreeItem existItem=getExistItem(existTable);
        TableNode existTableItem=getExistCheckedTable((TableNode)item.getData());
        if (existItem == null) {
          if (existTableItem == null) {
            return;
          }
 else {
            clearTableItem(existTableItem,true);
          }
        }
 else {
          clearTableItem(existItem);
          existItem.setChecked(false);
        }
        item.setText(3,Messages.getString("String_Node_Str"));
        countPending++;
        parentWizardPage.setPageComplete(false);
        refreshTable(item,-1);
      }
 else {
        item.setChecked(false);
        boolean hasCheckedItem=false;
        TreeItem parentItem=item.getParentItem();
        if (parentItem != null) {
          for (          TreeItem i : parentItem.getItems()) {
            if (i.getChecked()) {
              hasCheckedItem=true;
              break;
            }
          }
        }
        if (!hasCheckedItem) {
          parentItem.setChecked(false);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private void refreshExistItem(final MetadataTable existTable,final TreeItem item){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      orgomg.cwm.objectmodel.core.Package pack=(orgomg.cwm.objectmodel.core.Package)existTable.eContainer();
      boolean confirm=MessageDialog.openConfirm(Display.getDefault().getActiveShell(),"String_Node_Str","String_Node_Str" + existTable.getLabel() + "String_Node_Str"+ pack.getName()+ "String_Node_Str");
      if (confirm) {
        TreeItem existItem=getExistItem(existTable);
        TableNode existTableItem=getExistCheckedTable((TableNode)item.getData());
        if (existItem == null) {
          if (existTableItem == null) {
            return;
          }
 else {
            clearTableItem(existTableItem,true);
          }
        }
 else {
          clearTableItem(existItem);
          existItem.setChecked(false);
        }
        item.setText(3,Messages.getString("String_Node_Str"));
        countPending++;
        parentWizardPage.setPageComplete(false);
        refreshTable(item,-1);
      }
 else {
        item.setChecked(false);
        boolean hasCheckedItem=false;
        TreeItem parentItem=item.getParentItem();
        if (parentItem != null) {
          for (          TreeItem i : parentItem.getItems()) {
            if (i.getChecked()) {
              hasCheckedItem=true;
              break;
            }
          }
        }
        if (!hasCheckedItem && parentItem != null) {
          parentItem.setChecked(false);
        }
      }
    }
  }
);
}
Program: 129728
Project: 129728
Buggy source:
protected void deleteTable(TableNode tableItem){
  Collection<MetadataTable> tables=new ArrayList<MetadataTable>();
  Iterator<MetadataTable> iterate=ConnectionHelper.getTables(getConnection()).iterator();
  while (iterate.hasNext()) {
    MetadataTable metadata=iterate.next();
    if (metadata != null && metadata.getLabel().equals(tableItem.getValue())) {
      tables.add(metadata);
    }
  }
  TableNode parent=tableItem.getParent();
  String catalog="String_Node_Str";
  String schema="String_Node_Str";
  if (parent != null) {
    if (parent.getType() == TableNode.CATALOG) {
      catalog=parent.getValue();
    }
 else     if (parent.getType() == TableNode.SCHEMA) {
      schema=parent.getValue();
      TableNode catalogNode=parent.getParent();
      if (catalogNode != null) {
        catalog=catalogNode.getValue();
      }
    }
  }
  boolean isAccess=EDatabaseTypeName.ACCESS.getDisplayName().equals(metadataconnection.getDbType());
  if (isAccess) {
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,getConnection().getName(),getConnection(),tables);
  }
 else {
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,schema,getConnection(),tables);
  }
}

Fixed version (ground truth):
protected void deleteTable(TableNode tableItem){
  Collection<MetadataTable> tables=new ArrayList<MetadataTable>();
  Iterator<MetadataTable> iterate=ConnectionHelper.getTables(getConnection()).iterator();
  while (iterate.hasNext()) {
    MetadataTable metadata=iterate.next();
    if (metadata != null && metadata.getLabel().equals(tableItem.getValue())) {
      tables.add(metadata);
    }
  }
  TableNode parent=tableItem.getParent();
  String catalog="String_Node_Str";
  String schema="String_Node_Str";
  if (parent != null) {
    if (parent.getType() == TableNode.CATALOG) {
      catalog=parent.getValue();
    }
 else     if (parent.getType() == TableNode.SCHEMA) {
      schema=parent.getValue();
      TableNode catalogNode=parent.getParent();
      if (catalogNode != null) {
        catalog=catalogNode.getValue();
      }
    }
  }
  boolean isAccess=EDatabaseTypeName.ACCESS.getDisplayName().equals(metadataconnection.getDbType());
  if (isAccess) {
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,getConnection().getName(),getConnection(),tables);
  }
 else {
    if ("String_Node_Str".equals(schema) && ExtractMetaDataUtils.useAllSynonyms && EDatabaseTypeName.ORACLEFORSID.getDisplayName().equals(metadataconnection.getDbType())) {
      schema=MetadataConnectionUtils.FAKE_SCHEMA_SYNONYMS;
    }
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,schema,getConnection(),tables);
  }
}
Program: 129730
Project: 129730
Buggy source:
private void registerGlobalActions(){
  actionBarConfigurer.registerGlobalAction(ActionFactory.SAVE.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.UNDO.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.REDO.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.CUT.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.COPY.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.PASTE.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.DELETE.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.SELECT_ALL.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.REFRESH.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.RESET_PERSPECTIVE.create(window));
}

Fixed version (ground truth):
private void registerGlobalActions(){
  actionBarConfigurer.registerGlobalAction(ActionFactory.SAVE.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.SAVE_ALL.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.UNDO.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.REDO.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.CUT.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.COPY.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.PASTE.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.DELETE.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.SELECT_ALL.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.REFRESH.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.RESET_PERSPECTIVE.create(window));
}
Program: 129731
Project: 129731
Buggy source:
private void registerGlobalActions(){
  actionBarConfigurer.registerGlobalAction(ActionFactory.SAVE.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.UNDO.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.REDO.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.CUT.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.COPY.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.PASTE.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.DELETE.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.SELECT_ALL.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.REFRESH.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.RESET_PERSPECTIVE.create(window));
}

Fixed version (ground truth):
private void registerGlobalActions(){
  actionBarConfigurer.registerGlobalAction(ActionFactory.SAVE.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.SAVE_ALL.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.UNDO.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.REDO.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.CUT.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.COPY.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.PASTE.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.DELETE.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.SELECT_ALL.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.REFRESH.create(window));
  actionBarConfigurer.registerGlobalAction(ActionFactory.RESET_PERSPECTIVE.create(window));
}
Program: 129735
Project: 129735
Buggy source:
@Override public String getText(Object element){
  if (element instanceof RepositoryNode && !(element instanceof ProjectRepositoryNode)) {
    return repoLabelProv.getText(element);
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@Override public String getText(Object element){
  if (element instanceof RepositoryNode) {
    return repoLabelProv.getText(element);
  }
 else {
    return "String_Node_Str";
  }
}
Program: 129740
Project: 129740
Buggy source:
public boolean isNameAvailable(Project project,Item item,String name,List<IRepositoryViewObject>... givenList) throws PersistenceException {
  if (name == null) {
    name=item.getProperty().getLabel();
  }
  if (item instanceof FolderItem) {
    FolderHelper folderHelper=getFolderHelper(project.getEmfProject());
    return !folderHelper.pathExists((FolderItem)item,name);
  }
  ERepositoryObjectType type=ERepositoryObjectType.getItemType(item);
  if (type == ERepositoryObjectType.METADATA_CON_TABLE) {
    return false;
  }
  boolean isAllowMultipleName=(type == ERepositoryObjectType.SQLPATTERNS || type == ERepositoryObjectType.METADATA_FILE_XML);
  String path=null;
  if (item.getState() != null) {
    path=item.getState().getPath();
  }
  List<IRepositoryViewObject> list;
  if (givenList.length == 0) {
    list=getAll(project,type,true,false);
  }
 else {
    list=givenList[0];
  }
  for (  IRepositoryViewObject current : list) {
    if (name.equalsIgnoreCase(current.getProperty().getLabel()) && item.getProperty().getId() != current.getProperty().getId()) {
      if (!isAllowMultipleName || current.getProperty().getItem().getState().getPath().equals(path)) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean isNameAvailable(Project project,Item item,String name,List<IRepositoryViewObject>... givenList) throws PersistenceException {
  if (name == null) {
    name=item.getProperty().getLabel();
  }
  if (item instanceof FolderItem) {
    FolderHelper folderHelper=getFolderHelper(project.getEmfProject());
    return !folderHelper.pathExists((FolderItem)item,name);
  }
  ERepositoryObjectType type=ERepositoryObjectType.getItemType(item);
  if (type == ERepositoryObjectType.METADATA_CON_TABLE) {
    return false;
  }
  boolean isAllowMultipleName=(type == ERepositoryObjectType.SQLPATTERNS || type == ERepositoryObjectType.METADATA_FILE_XML);
  String path="String_Node_Str";
  if (item.getState() != null) {
    path=item.getState().getPath();
  }
  List<IRepositoryViewObject> list;
  if (givenList.length == 0) {
    list=getAll(project,type,true,false);
  }
 else {
    list=givenList[0];
  }
  for (  IRepositoryViewObject current : list) {
    if (name.equalsIgnoreCase(current.getProperty().getLabel()) && item.getProperty().getId() != current.getProperty().getId()) {
      if (!isAllowMultipleName || current.getProperty().getItem().getState().getPath().equals(path)) {
        return false;
      }
    }
  }
  return true;
}
Program: 129741
Project: 129741
Buggy source:
/** 
 * This calls the refresh of the toplevel node, this must be invoke from the UI thread.
 * @param topLevelNode
 */
protected void refreshTopLevelNode(){
  RepositoryNode topLevelNode=getTopLevelNode();
  topLevelNode.setInitialized(false);
  topLevelNode.getChildren().clear();
  if (topLevelNode.getParent() instanceof ProjectRepositoryNode) {
    ((ProjectRepositoryNode)topLevelNode.getParent()).clearNodeAndProjectCash();
  }
  viewer.refresh(topLevelNode);
}

Fixed version (ground truth):
/** 
 * This calls the refresh of the toplevel node, this must be invoke from the UI thread.
 * @param topLevelNode
 */
protected void refreshTopLevelNode(){
  RepositoryNode topLevelNode=getTopLevelNode();
  if (topLevelNode != null) {
    topLevelNode.setInitialized(false);
    topLevelNode.getChildren().clear();
    if (topLevelNode.getParent() instanceof ProjectRepositoryNode) {
      ((ProjectRepositoryNode)topLevelNode.getParent()).clearNodeAndProjectCash();
    }
    viewer.refresh(topLevelNode);
  }
}
Program: 129743
Project: 129743
Buggy source:
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  if (super.isVisible()) {
    if (getConnection().getXmlFilePath() != null && !getConnection().getXmlFilePath().equals("String_Node_Str") && new File(getConnection().getXmlFilePath()).exists()) {
      runShadowProcess(true);
    }
    ((XmlFileWizard)getPage().getWizard()).setXsdRootChange(false);
    if (isReadOnly() != readOnly) {
      adaptFormToReadOnly();
    }
  }
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  if (super.isVisible()) {
    if (getConnection().getXmlFilePath() != null && !getConnection().getXmlFilePath().equals("String_Node_Str") && (new File(getConnection().getXmlFilePath()).exists() || new File(getContextXmlPath(getConnection())).exists())) {
      runShadowProcess(true);
    }
    ((XmlFileWizard)getPage().getWizard()).setXsdRootChange(false);
    if (isReadOnly() != readOnly) {
      adaptFormToReadOnly();
    }
  }
}
Program: 129744
Project: 129744
Buggy source:
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  if (super.isVisible()) {
    if (getConnection().getXmlFilePath() != null && !getConnection().getXmlFilePath().equals("String_Node_Str") && new File(getConnection().getXmlFilePath()).exists()) {
      runShadowProcess(true);
    }
    ((XmlFileWizard)getPage().getWizard()).setXsdRootChange(false);
    if (isReadOnly() != readOnly) {
      adaptFormToReadOnly();
    }
  }
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  if (super.isVisible()) {
    if (getConnection().getXmlFilePath() != null && !getConnection().getXmlFilePath().equals("String_Node_Str") && (new File(getConnection().getXmlFilePath()).exists() || new File(getContextXmlPath(getConnection())).exists())) {
      runShadowProcess(true);
    }
    ((XmlFileWizard)getPage().getWizard()).setXsdRootChange(false);
    if (isReadOnly() != readOnly) {
      adaptFormToReadOnly();
    }
  }
}
Program: 129749
Project: 129749
Buggy source:
/** 
 * run a ShadowProcess to determined the Metadata.
 */
protected void runShadowProcess(Boolean flag){
  XmlFileConnection connection2=getConnection();
  if (XmlUtil.isXSDFile(connection2.getXmlFilePath())) {
    refreshMetaDataTable(null,((XmlXPathLoopDescriptor)connection2.getSchema().get(0)).getSchemaTargets(),flag);
    checkFieldsValue();
    return;
  }
  try {
    informationLabel.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    CsvArray csvArray=ShadowProcessHelper.getCsvArray(getProcessDescription(true),"String_Node_Str");
    if (csvArray == null) {
      informationLabel.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    }
 else {
      refreshMetaDataTable(csvArray,((XmlXPathLoopDescriptor)connection2.getSchema().get(0)).getSchemaTargets(),flag);
    }
  }
 catch (  CoreException e) {
    if (getParent().getChildren().length == 1) {
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str") + "String_Node_Str" + Messages.getString("String_Node_Str"),e.getMessage());
    }
 else {
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),e.getMessage());
    }
    log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
  }
  checkFieldsValue();
}

Fixed version (ground truth):
/** 
 * run a ShadowProcess to determined the Metadata.
 */
protected void runShadowProcess(Boolean flag){
  XmlFileConnection connection2=getConnection();
  String tempXmlFilePath=getContextXmlPath(connection2);
  if (tempXmlFilePath == null ? XmlUtil.isXSDFile(connection2.getXmlFilePath()) : XmlUtil.isXSDFile(connection2.getXmlFilePath()) || XmlUtil.isXSDFile(tempXmlFilePath)) {
    refreshMetaDataTable(null,((XmlXPathLoopDescriptor)connection2.getSchema().get(0)).getSchemaTargets(),flag);
    checkFieldsValue();
    return;
  }
  try {
    informationLabel.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    CsvArray csvArray=ShadowProcessHelper.getCsvArray(getProcessDescription(true),"String_Node_Str");
    if (csvArray == null) {
      informationLabel.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    }
 else {
      refreshMetaDataTable(csvArray,((XmlXPathLoopDescriptor)connection2.getSchema().get(0)).getSchemaTargets(),flag);
    }
  }
 catch (  CoreException e) {
    if (getParent().getChildren().length == 1) {
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str") + "String_Node_Str" + Messages.getString("String_Node_Str"),e.getMessage());
    }
 else {
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),e.getMessage());
    }
    log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
  }
  checkFieldsValue();
}
Program: 129753
Project: 129753
Buggy source:
/** 
 * get absolute path of the filePath
 * @param filePath
 * @return
 */
public String getAbsolutePath(String filePath){
  return this.getfileURL(filePath).getPath();
}

Fixed version (ground truth):
/** 
 * get absolute path of the filePath
 * @param filePath
 * @return
 */
public String getAbsolutePath(String filePath){
  String path=this.getfileURL(filePath).getPath();
  if (System.getProperty("String_Node_Str").startsWith("String_Node_Str")) {
    if (path.startsWith("String_Node_Str")) {
      path=path.substring(1);
    }
    path=path.replace("String_Node_Str","String_Node_Str");
  }
  return path;
}
Program: 129754
Project: 129754
Buggy source:
/** 
 * run a ShadowProcess to determined the Metadata.
 */
protected void runShadowProcess(Boolean flag){
  XmlFileConnection connection2=getConnection();
  if (XmlUtil.isXSDFile(connection2.getXmlFilePath())) {
    refreshMetaDataTable(null,((XmlXPathLoopDescriptor)connection2.getSchema().get(0)).getSchemaTargets(),flag);
    checkFieldsValue();
    return;
  }
  try {
    informationLabel.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    CsvArray csvArray=ShadowProcessHelper.getCsvArray(getProcessDescription(true),"String_Node_Str");
    if (csvArray == null) {
      informationLabel.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    }
 else {
      refreshMetaDataTable(csvArray,((XmlXPathLoopDescriptor)connection2.getSchema().get(0)).getSchemaTargets(),flag);
    }
  }
 catch (  CoreException e) {
    if (getParent().getChildren().length == 1) {
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str") + "String_Node_Str" + Messages.getString("String_Node_Str"),e.getMessage());
    }
 else {
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),e.getMessage());
    }
    log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
  }
  checkFieldsValue();
}

Fixed version (ground truth):
/** 
 * run a ShadowProcess to determined the Metadata.
 */
protected void runShadowProcess(Boolean flag){
  XmlFileConnection connection2=getConnection();
  String tempXmlFilePath=getContextXmlPath(connection2);
  if (tempXmlFilePath == null ? XmlUtil.isXSDFile(connection2.getXmlFilePath()) : XmlUtil.isXSDFile(connection2.getXmlFilePath()) || XmlUtil.isXSDFile(tempXmlFilePath)) {
    refreshMetaDataTable(null,((XmlXPathLoopDescriptor)connection2.getSchema().get(0)).getSchemaTargets(),flag);
    checkFieldsValue();
    return;
  }
  try {
    informationLabel.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    CsvArray csvArray=ShadowProcessHelper.getCsvArray(getProcessDescription(true),"String_Node_Str");
    if (csvArray == null) {
      informationLabel.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    }
 else {
      refreshMetaDataTable(csvArray,((XmlXPathLoopDescriptor)connection2.getSchema().get(0)).getSchemaTargets(),flag);
    }
  }
 catch (  CoreException e) {
    if (getParent().getChildren().length == 1) {
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str") + "String_Node_Str" + Messages.getString("String_Node_Str"),e.getMessage());
    }
 else {
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),e.getMessage());
    }
    log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
  }
  checkFieldsValue();
}
Program: 129758
Project: 129758
Buggy source:
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!ERepositoryObjectType.METADATA_MDMCONNECTION.equals(nodeType)) {
    setEnabled(false);
    return;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
    if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
      setEnabled(false);
      return;
    }
  this.setText(CREATE_LABEL);
this.setImageDescriptor(createImage);
collectChildNames(node);
break;
case REPOSITORY_ELEMENT:
if (factory.isPotentiallyEditable(node.getObject())) {
this.setText(EDIT_LABEL);
this.setImageDescriptor(defaultImage);
collectSiblingNames(node);
}
 else {
this.setText(OPEN_LABEL);
this.setImageDescriptor(defaultImage);
}
break;
default :
return;
}
setEnabled(true);
}

Fixed version (ground truth):
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!ERepositoryObjectType.METADATA_MDMCONNECTION.equals(nodeType)) {
    setEnabled(false);
    return;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case SIMPLE_FOLDER:
    if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
      setEnabled(false);
      return;
    }
case SYSTEM_FOLDER:
  if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
    setEnabled(false);
    return;
  }
this.setText(CREATE_LABEL);
this.setImageDescriptor(createImage);
collectChildNames(node);
break;
case REPOSITORY_ELEMENT:
if (factory.isPotentiallyEditable(node.getObject())) {
this.setText(EDIT_LABEL);
this.setImageDescriptor(defaultImage);
collectSiblingNames(node);
}
 else {
this.setText(OPEN_LABEL);
this.setImageDescriptor(defaultImage);
}
break;
default :
return;
}
setEnabled(true);
}
Program: 129759
Project: 129759
Buggy source:
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!ERepositoryObjectType.METADATA_MDMCONNECTION.equals(nodeType)) {
    setEnabled(false);
    return;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
    if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
      setEnabled(false);
      return;
    }
  this.setText(CREATE_LABEL);
this.setImageDescriptor(createImage);
collectChildNames(node);
break;
case REPOSITORY_ELEMENT:
if (factory.isPotentiallyEditable(node.getObject())) {
this.setText(EDIT_LABEL);
this.setImageDescriptor(defaultImage);
collectSiblingNames(node);
}
 else {
this.setText(OPEN_LABEL);
this.setImageDescriptor(defaultImage);
}
break;
default :
return;
}
setEnabled(true);
}

Fixed version (ground truth):
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!ERepositoryObjectType.METADATA_MDMCONNECTION.equals(nodeType)) {
    setEnabled(false);
    return;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case SIMPLE_FOLDER:
    if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
      setEnabled(false);
      return;
    }
case SYSTEM_FOLDER:
  if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
    setEnabled(false);
    return;
  }
this.setText(CREATE_LABEL);
this.setImageDescriptor(createImage);
collectChildNames(node);
break;
case REPOSITORY_ELEMENT:
if (factory.isPotentiallyEditable(node.getObject())) {
this.setText(EDIT_LABEL);
this.setImageDescriptor(defaultImage);
collectSiblingNames(node);
}
 else {
this.setText(OPEN_LABEL);
this.setImageDescriptor(defaultImage);
}
break;
default :
return;
}
setEnabled(true);
}
Program: 129760
Project: 129760
Buggy source:
protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!ERepositoryObjectType.METADATA_FILE_DELIMITED.equals(nodeType)) {
    return;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
    if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
      setEnabled(false);
      return;
    }
  this.setText(CREATE_LABEL);
collectChildNames(node);
this.setImageDescriptor(createImage);
creation=true;
break;
case REPOSITORY_ELEMENT:
if (factory.isPotentiallyEditable(node.getObject())) {
this.setText(EDIT_LABEL);
this.setImageDescriptor(defaultImage);
collectSiblingNames(node);
}
 else {
this.setText(OPEN_LABEL);
this.setImageDescriptor(defaultImage);
}
collectSiblingNames(node);
creation=false;
break;
default :
return;
}
setEnabled(true);
}

Fixed version (ground truth):
protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!ERepositoryObjectType.METADATA_FILE_DELIMITED.equals(nodeType)) {
    return;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case SIMPLE_FOLDER:
    if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
      setEnabled(false);
      return;
    }
case SYSTEM_FOLDER:
  if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
    setEnabled(false);
    return;
  }
this.setText(CREATE_LABEL);
collectChildNames(node);
this.setImageDescriptor(createImage);
creation=true;
break;
case REPOSITORY_ELEMENT:
if (factory.isPotentiallyEditable(node.getObject())) {
this.setText(EDIT_LABEL);
this.setImageDescriptor(defaultImage);
collectSiblingNames(node);
}
 else {
this.setText(OPEN_LABEL);
this.setImageDescriptor(defaultImage);
}
collectSiblingNames(node);
creation=false;
break;
default :
return;
}
setEnabled(true);
}
Program: 129761
Project: 129761
Buggy source:
protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!ERepositoryObjectType.METADATA_FILE_EXCEL.equals(nodeType)) {
    return;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
    if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
      setEnabled(false);
      return;
    }
  this.setText(CREATE_LABEL);
collectChildNames(node);
creation=true;
this.setImageDescriptor(createImage);
break;
case REPOSITORY_ELEMENT:
if (factory.isPotentiallyEditable(node.getObject())) {
this.setText(EDIT_LABEL);
this.setImageDescriptor(defaultImage);
collectSiblingNames(node);
}
 else {
this.setText(OPEN_LABEL);
this.setImageDescriptor(defaultImage);
}
collectSiblingNames(node);
creation=false;
break;
}
setEnabled(true);
}

Fixed version (ground truth):
protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!ERepositoryObjectType.METADATA_FILE_EXCEL.equals(nodeType)) {
    return;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case SIMPLE_FOLDER:
    if (node.getObject() != null && node.getObject().getProperty().getItem().getState().isDeleted()) {
      setEnabled(false);
      return;
    }
case SYSTEM_FOLDER:
  if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
    setEnabled(false);
    return;
  }
this.setText(CREATE_LABEL);
collectChildNames(node);
creation=true;
this.setImageDescriptor(createImage);
break;
case REPOSITORY_ELEMENT:
if (factory.isPotentiallyEditable(node.getObject())) {
this.setText(EDIT_LABEL);
this.setImageDescriptor(defaultImage);
collectSiblingNames(node);
}
 else {
this.setText(OPEN_LABEL);
this.setImageDescriptor(defaultImage);
}
collectSiblingNames(node);
creation=false;
break;
}
setEnabled(true);
}