nus-yam/ex-repair huggingface dataset:
Program: 141745
Project: 141745
Buggy source:
@Override protected void doRun(){
  List<IRepositoryViewObject> xmlObjs=initFileConnection();
  final Map<String,IRepositoryViewObject> selectTables=new HashMap<String,IRepositoryViewObject>();
  if (xmlObjs.size() > 0) {
    RewriteSchemaDialog selectContextDialog=new RewriteSchemaDialog(Display.getDefault().getActiveShell(),xmlObjs);
    if (selectContextDialog.open() == Window.OK) {
      selectTables.putAll(selectContextDialog.getSelectionTables());
    }
 else {
      return;
    }
  }
  final IWorkspaceRunnable op=new IWorkspaceRunnable(){
    public void run(    IProgressMonitor monitor) throws CoreException {
      importSchema(monitor,selectTables);
    }
  }
;
  IRunnableWithProgress iRunnableWithProgress=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      try {
        ISchedulingRule schedulingRule=workspace.getRoot();
        workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
      }
 catch (      CoreException e) {
        throw new InvocationTargetException(e);
      }
    }
  }
;
  try {
    if (needProgressBar) {
      new ProgressMonitorDialog(null).run(true,true,iRunnableWithProgress);
    }
 else {
      PlatformUI.getWorkbench().getProgressService().run(true,true,iRunnableWithProgress);
    }
  }
 catch (  InvocationTargetException e) {
    ExceptionHandler.process(e);
  }
catch (  InterruptedException e) {
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  List<IRepositoryViewObject> xmlObjs=initFileConnection();
  final Map<String,IRepositoryViewObject> selectTables=new HashMap<String,IRepositoryViewObject>();
  if (xmlObjs.size() > 0) {
    RewriteSchemaDialog selectContextDialog=new RewriteSchemaDialog(Display.getDefault().getActiveShell(),xmlObjs);
    if (selectContextDialog.open() == Window.OK) {
      selectTables.putAll(selectContextDialog.getSelectionTables());
    }
 else {
      return;
    }
  }
  final IWorkspaceRunnable op=new IWorkspaceRunnable(){
    public void run(    IProgressMonitor monitor) throws CoreException {
      importSchema(monitor,selectTables);
    }
  }
;
  IRunnableWithProgress iRunnableWithProgress=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      try {
        ISchedulingRule schedulingRule=workspace.getRoot();
        workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
      }
 catch (      CoreException e) {
        throw new InvocationTargetException(e);
      }
    }
  }
;
  try {
    new ProgressMonitorDialog(null).run(true,true,iRunnableWithProgress);
  }
 catch (  InvocationTargetException e) {
    ExceptionHandler.process(e);
  }
catch (  InterruptedException e) {
  }
}
Program: 141746
Project: 141746
Buggy source:
public IProcess getProcessFromItem(Item item,boolean loadScreenshots){
  if (CamelProcessItemImpl.class == item.getClass()) {
    RouteProcess process=null;
    process=new RouteProcess(item.getProperty());
    return process;
  }
  return null;
}

Fixed version (ground truth):
public IProcess getProcessFromItem(Item item,boolean loadScreenshots){
  if (CamelProcessItemImpl.class == item.getClass()) {
    RouteProcess process=null;
    process=new RouteProcess(item.getProperty());
    process.loadXmlFile(loadScreenshots);
    return process;
  }
  return null;
}
Program: 141747
Project: 141747
Buggy source:
public IProcess getProcessFromItem(Item item,boolean loadScreenshots){
  if ("String_Node_Str".equals(item.eClass().getName())) {
    RouteProcess process=null;
    process=new RouteProcess(item.getProperty());
    return process;
  }
  return null;
}

Fixed version (ground truth):
public IProcess getProcessFromItem(Item item,boolean loadScreenshots){
  if (CamelProcessItemImpl.class == item.getClass()) {
    RouteProcess process=null;
    process=new RouteProcess(item.getProperty());
    return process;
  }
  return null;
}
Program: 141748
Project: 141748
Buggy source:
public IProcess getProcessFromItem(Item item,boolean loadScreenshots){
  if (CamelProcessItem.class.equals(item.getClass())) {
    RouteProcess process=null;
    process=new RouteProcess(item.getProperty());
    return process;
  }
  return null;
}

Fixed version (ground truth):
public IProcess getProcessFromItem(Item item,boolean loadScreenshots){
  if ("String_Node_Str".equals(item.eClass().getName())) {
    RouteProcess process=null;
    process=new RouteProcess(item.getProperty());
    return process;
  }
  return null;
}
Program: 141749
Project: 141749
Buggy source:
public IProcess getProcessFromItem(Item item,boolean loadScreenshots){
  if (CamelProcessItemImpl.class == item.getClass()) {
    RouteProcess process=null;
    process=new RouteProcess(item.getProperty());
    return process;
  }
  return null;
}

Fixed version (ground truth):
public IProcess getProcessFromItem(Item item,boolean loadScreenshots){
  if (CamelProcessItemImpl.class == item.getClass()) {
    RouteProcess process=null;
    process=new RouteProcess(item.getProperty());
    process.loadXmlFile(loadScreenshots);
    return process;
  }
  return null;
}
Program: 141750
Project: 141750
Buggy source:
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  List<RepositoryNode> nodes=selection.toList();
  if (nodes == null || nodes.size() != 1) {
    setEnabled(false);
    return;
  }
  RepositoryNode node=nodes.iterator().next();
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    setEnabled(false);
    return;
  }
  this.setText(createLabel);
  this.setImageDescriptor(ImageProvider.getImageDesc(ECoreImage.PROCESS_ICON));
  String jobId=getReferenceJobId(node);
  if (jobId == null) {
    setEnabled(false);
    return;
  }
  jobNode=RepositoryNodeUtilities.getRepositoryNode(jobId,false);
  final IStructuredSelection jobSelection=new StructuredSelection(jobNode);
  setSpecialSelection(new ISelectionProvider(){
    public void setSelection(    ISelection arg0){
    }
    public void removeSelectionChangedListener(    ISelectionChangedListener arg0){
    }
    public ISelection getSelection(){
      return jobSelection;
    }
    public void addSelectionChangedListener(    ISelectionChangedListener arg0){
    }
  }
);
  super.init(viewer,jobSelection);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  List<RepositoryNode> nodes=selection.toList();
  if (nodes == null || nodes.size() != 1) {
    setEnabled(false);
    return;
  }
  RepositoryNode node=nodes.iterator().next();
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    setEnabled(false);
    return;
  }
  this.setText(createLabel);
  this.setImageDescriptor(ImageProvider.getImageDesc(ECoreImage.PROCESS_ICON));
  String jobId=getReferenceJobId(node);
  if (jobId == null) {
    setEnabled(false);
    return;
  }
  jobNode=RepositoryNodeUtilities.getRepositoryNode(jobId,false);
  if (jobNode == null) {
    removeReferenecJobId(node);
    setEnabled(false);
    return;
  }
  final IStructuredSelection jobSelection=new StructuredSelection(jobNode);
  setSpecialSelection(new ISelectionProvider(){
    public void setSelection(    ISelection arg0){
    }
    public void removeSelectionChangedListener(    ISelectionChangedListener arg0){
    }
    public ISelection getSelection(){
      return jobSelection;
    }
    public void addSelectionChangedListener(    ISelectionChangedListener arg0){
    }
  }
);
  super.init(viewer,jobSelection);
}
Program: 141751
Project: 141751
Buggy source:
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  List<RepositoryNode> nodes=selection.toList();
  if (nodes == null || nodes.size() != 1) {
    setEnabled(false);
    return;
  }
  RepositoryNode node=nodes.iterator().next();
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    setEnabled(false);
    return;
  }
  this.setText(createLabel);
  this.setImageDescriptor(ImageProvider.getImageDesc(ECoreImage.PROCESS_ICON));
  String jobId=getReferenceJobId(node);
  if (jobId == null) {
    setEnabled(false);
    return;
  }
  jobNode=RepositoryNodeUtilities.getRepositoryNode(jobId,false);
  final IStructuredSelection jobSelection=new StructuredSelection(jobNode);
  setSpecialSelection(new ISelectionProvider(){
    public void setSelection(    ISelection arg0){
    }
    public void removeSelectionChangedListener(    ISelectionChangedListener arg0){
    }
    public ISelection getSelection(){
      return jobSelection;
    }
    public void addSelectionChangedListener(    ISelectionChangedListener arg0){
    }
  }
);
  super.init(viewer,jobSelection);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  List<RepositoryNode> nodes=selection.toList();
  if (nodes == null || nodes.size() != 1) {
    setEnabled(false);
    return;
  }
  RepositoryNode node=nodes.iterator().next();
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    setEnabled(false);
    return;
  }
  this.setText(createLabel);
  this.setImageDescriptor(ImageProvider.getImageDesc(ECoreImage.PROCESS_ICON));
  String jobId=getReferenceJobId(node);
  if (jobId == null) {
    setEnabled(false);
    return;
  }
  jobNode=RepositoryNodeUtilities.getRepositoryNode(jobId,false);
  if (jobNode == null) {
    removeReferenecJobId(node);
    setEnabled(false);
    return;
  }
  final IStructuredSelection jobSelection=new StructuredSelection(jobNode);
  setSpecialSelection(new ISelectionProvider(){
    public void setSelection(    ISelection arg0){
    }
    public void removeSelectionChangedListener(    ISelectionChangedListener arg0){
    }
    public ISelection getSelection(){
      return jobSelection;
    }
    public void addSelectionChangedListener(    ISelectionChangedListener arg0){
    }
  }
);
  super.init(viewer,jobSelection);
}
Program: 141752
Project: 141752
Buggy source:
public Class getClassForDoubleClick(){
  try {
    RepositoryNode repositoryNode=super.getCurrentRepositoryNode();
    return (getReferenceJobId(repositoryNode) != null) ? ServiceOperation.class : Object.class;
  }
 catch (  Exception e) {
  }
  return ServiceOperation.class;
}

Fixed version (ground truth):
@Override public Class getClassForDoubleClick(){
  try {
    RepositoryNode repositoryNode=super.getCurrentRepositoryNode();
    return (getReferenceJobId(repositoryNode) != null) ? ServiceOperation.class : Object.class;
  }
 catch (  Exception e) {
  }
  return ServiceOperation.class;
}
Program: 141753
Project: 141753
Buggy source:
public String getTmpFolderPath(){
  Project project=ProjectManager.getInstance().getCurrentProject();
  String tmpFolderPath;
  try {
    IProject physProject=ResourceModelUtils.getProject(project);
    tmpFolderPath=physProject.getFolder("String_Node_Str").getLocation().toPortableString();
  }
 catch (  Exception e) {
    tmpFolderPath=System.getProperty("String_Node_Str");
  }
  tmpFolderPath=tmpFolderPath + "String_Node_Str";
  File tmpFolder=new File(tmpFolderPath);
  if (!tmpFolder.exists()) {
    tmpFolder.mkdirs();
  }
  return tmpFolderPath;
}

Fixed version (ground truth):
public String getTmpFolderPath(){
  if (tempFolder != null) {
    return tempFolder;
  }
  Project project=ProjectManager.getInstance().getCurrentProject();
  String tmpFolderPath;
  try {
    IProject physProject=ResourceModelUtils.getProject(project);
    tmpFolderPath=physProject.getFolder("String_Node_Str").getLocation().toPortableString();
  }
 catch (  Exception e) {
    tmpFolderPath=System.getProperty("String_Node_Str");
  }
  tmpFolderPath=tmpFolderPath + "String_Node_Str";
  File tmpFolder=new File(tmpFolderPath);
  if (!tmpFolder.exists()) {
    tmpFolder.mkdirs();
  }
  File tmpExportFolder=null;
  try {
    tmpExportFolder=File.createTempFile("String_Node_Str",null,tmpFolder);
    if (tmpExportFolder.exists() && tmpExportFolder.isFile()) {
      tmpExportFolder.delete();
      tmpExportFolder.mkdirs();
    }
  }
 catch (  IOException e) {
  }
 finally {
    if (tmpExportFolder != null) {
      tmpExportFolder.deleteOnExit();
    }
  }
  if (tmpExportFolder != null) {
    tmpFolder=tmpExportFolder;
  }
  return tmpFolder.getAbsolutePath();
}
Program: 141757
Project: 141757
Buggy source:
public void updateTitleImage(){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      Image image=null;
      if (getProcess() == null) {
        return;
      }
      InformationLevel level=getProcess().getProperty().getMaxInformationLevel();
      if (level.equals(InformationLevel.ERROR_LITERAL)) {
        image=OverlayImageProvider.getImageWithError(ImageProvider.getImage(ECamelCoreImage.ROUTES_ICON)).createImage();
      }
 else {
        image=ImageProvider.getImage(ECamelCoreImage.ROUTES_ICON);
      }
      setTitleImage(image);
    }
  }
);
}

Fixed version (ground truth):
@Override public void updateTitleImage(){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      Image image=null;
      if (getProcess() == null) {
        return;
      }
      InformationLevel level=getProcess().getProperty().getMaxInformationLevel();
      if (level.equals(InformationLevel.ERROR_LITERAL)) {
        image=OverlayImageProvider.getImageWithError(ImageProvider.getImage(ECamelCoreImage.ROUTES_ICON)).createImage();
      }
 else {
        image=ImageProvider.getImage(ECamelCoreImage.ROUTES_ICON);
      }
      setTitleImage(image);
    }
  }
);
}
Program: 141758
Project: 141758
Buggy source:
/** 
 * Getter for designerEditor.
 * @return the designerEditor
 */
public AbstractTalendEditor getDesignerEditor(){
  return this.designerEditor;
}

Fixed version (ground truth):
/** 
 * Getter for designerEditor.
 * @return the designerEditor
 */
@Override public AbstractTalendEditor getDesignerEditor(){
  return this.designerEditor;
}
Program: 141764
Project: 141764
Buggy source:
/** 
 * DOC ycbai ExportServiceWithMavenAction constructor comment.
 * @param exportChoiceMap
 * @param node
 * @param targetPath
 * @throws InvocationTargetException
 */
public ExportServiceWithMavenAction(ServiceExportWithMavenManager manager,Map<ExportChoice,Object> exportChoiceMap,RepositoryNode node,String targetPath) throws InvocationTargetException {
  super(exportChoiceMap,node,targetPath);
  this.manager=manager;
}

Fixed version (ground truth):
/** 
 * DOC ycbai ExportServiceWithMavenAction constructor comment.
 * @param exportChoiceMap
 * @param node
 * @param targetPath
 * @throws InvocationTargetException
 */
public ExportServiceWithMavenAction(ServiceExportWithMavenManager manager,Map<ExportChoice,Object> exportChoiceMap,RepositoryNode node,String targetPath) throws InvocationTargetException {
  super(exportChoiceMap,node,targetPath);
  this.manager=manager;
  this.manager.setMavenGroupId(this.getGroupId());
}
Program: 141765
Project: 141765
Buggy source:
private void addJobFilesToExport(IProgressMonitor monitor) throws Exception {
  String directoryName=serviceManager.getRootFolderName(tempFolder);
  exportChoiceMap.put(ExportChoice.needJobItem,false);
  for (  RepositoryNode node : nodes) {
    JobScriptsManager manager=new OSGIJavaScriptForESBWithMavenManager(exportChoiceMap,"String_Node_Str","String_Node_Str",IProcessor.NO_STATISTICS,IProcessor.NO_TRACES);
    String artefactName=serviceManager.getNodeLabel(node);
    String version=node.getObject().getVersion();
    String destinationPath=tempFolder + PATH_SEPERATOR + artefactName+ manager.getOutputSuffix();
    manager.setDestinationPath(destinationPath);
    JobExportAction job=new JobExportAction(Collections.singletonList(node),version,manager,directoryName);
    job.run(monitor);
    ZipToFile.unZipFile(destinationPath,tempFolder + PATH_SEPERATOR + ServiceExportWithMavenManager.OPERATIONS_PATH+ artefactName);
    FilesUtils.removeFile(new File(destinationPath));
  }
}

Fixed version (ground truth):
private void addJobFilesToExport(IProgressMonitor monitor) throws Exception {
  String directoryName=serviceManager.getRootFolderName(tempFolder);
  exportChoiceMap.put(ExportChoice.needJobItem,false);
  for (  RepositoryNode node : nodes) {
    JobScriptsManager osgiManager=new OSGIJavaScriptForESBWithMavenManager(exportChoiceMap,"String_Node_Str","String_Node_Str",IProcessor.NO_STATISTICS,IProcessor.NO_TRACES){
      @Override protected Map<String,String> getMainMavenProperties(      Item item){
        Map<String,String> mavenPropertiesMap=super.getMainMavenProperties(item);
        mavenPropertiesMap.put(EMavenBuildScriptProperties.ItemGroupName.getVarScript(),getGroupId());
        return mavenPropertiesMap;
      }
      @Override protected void setMavenBuildScriptProperties(      Document pomDocument,      Map<String,String> mavenPropertiesMap){
        super.setMavenBuildScriptProperties(pomDocument,mavenPropertiesMap);
        String itemName=mavenPropertiesMap.get(EMavenBuildScriptProperties.ItemName.getVarScript());
        if (itemName != null && pomDocument != null) {
          Element rootElement=pomDocument.getRootElement();
          Element artifactIdEle=rootElement.element("String_Node_Str");
          if (artifactIdEle != null) {
            artifactIdEle.setText(itemName);
          }
        }
      }
    }
;
    String artefactName=serviceManager.getNodeLabel(node);
    String version=node.getObject().getVersion();
    String destinationPath=tempFolder + PATH_SEPERATOR + artefactName+ osgiManager.getOutputSuffix();
    osgiManager.setDestinationPath(destinationPath);
    JobExportAction job=new JobExportAction(Collections.singletonList(node),version,osgiManager,directoryName);
    job.run(monitor);
    ZipToFile.unZipFile(destinationPath,tempFolder + PATH_SEPERATOR + ServiceExportWithMavenManager.OPERATIONS_PATH+ artefactName);
    FilesUtils.removeFile(new File(destinationPath));
  }
}
Program: 141766
Project: 141766
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  super.run(monitor);
  try {
    addServiceFilesToExport();
    addJobFilesToExport(monitor);
    addMavenFilesToExport(monitor);
    super.processFinalResult(serviceManager.getDestinationPath());
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
 finally {
    super.clean();
  }
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  super.run(monitor);
  try {
    addServiceFilesToExport();
    addJobFilesToExport(monitor);
    addMavenFilesToExport(monitor);
    super.processFinalResult(serviceManager.getDestinationPath());
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
 finally {
    super.clean();
  }
}
Program: 141768
Project: 141768
Buggy source:
protected void exportKarOsgiBundles() throws InvocationTargetException, InterruptedException {
  String displayName=routeNode.getObject().getProperty().getDisplayName();
  String routerBundlePath=getTempDir() + displayName + "String_Node_Str"+ version+ "String_Node_Str";
  if (processRoute(routerBundlePath,routeNode,version)) {
    exportOsgiBundle(routeNode,routerBundlePath,version,bundleVersion,"String_Node_Str");
    exportAllReferenceJobs(routeNode);
  }
}

Fixed version (ground truth):
protected void exportKarOsgiBundles() throws InvocationTargetException, InterruptedException {
  String routerBundlePath=getTempDir() + getNodeBundleName(routeNode,version) + JAR_SUFFIX;
  if (processRoute(routerBundlePath,routeNode,version)) {
    exportOsgiBundle(routeNode,routerBundlePath,version,bundleVersion,"String_Node_Str");
    exportAllReferenceJobs(routeNode);
  }
}
Program: 141769
Project: 141769
Buggy source:
public JavaCamelJobScriptsExportWithMavenAction(Map<ExportChoice,Object> exportChoiceMap,RepositoryNode routeNode,String version,String destinationPath,boolean addStatisticsCode){
  super(routeNode,version,destinationPath,addStatisticsCode);
  this.destinationPath=destinationPath;
  if (!destinationKar.endsWith(DEFAULT_SUFFIX)) {
    destinationKar=destinationKar.substring(0,destinationKar.lastIndexOf("String_Node_Str"));
    destinationKar=destinationKar + DEFAULT_SUFFIX;
  }
  scriptsManager=new KarafJavaScriptForESBWithMavenManager(exportChoiceMap,destinationKar,null,null,IProcessor.NO_STATISTICS,IProcessor.NO_TRACES);
}

Fixed version (ground truth):
public JavaCamelJobScriptsExportWithMavenAction(Map<ExportChoice,Object> exportChoiceMap,RepositoryNode routeNode,String version,String destinationPath,boolean addStatisticsCode){
  super(routeNode,version,destinationPath,addStatisticsCode);
  this.destinationPath=destinationPath;
  if (!destinationKar.endsWith(KAR_SUFFIX)) {
    destinationKar=getTempDir() + File.separatorChar + getNodeBundleName(routeNode,version)+ KAR_SUFFIX;
  }
  scriptsManager=new KarafJavaScriptForESBWithMavenManager(exportChoiceMap,destinationKar,null,null,IProcessor.NO_STATISTICS,IProcessor.NO_TRACES);
}
Program: 141770
Project: 141770
Buggy source:
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  this.monitor=monitor;
  try {
    exportKarOsgiBundles();
    processResults();
    exportMavenResources();
  }
  finally {
    FilesUtils.removeFolder(getTempDir(),true);
    FilesUtils.removeFile(new File(destinationKar));
  }
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  this.monitor=monitor;
  try {
    exportKarOsgiBundles();
    processResults();
    exportMavenResources();
  }
  finally {
    FilesUtils.removeFolder(getTempDir(),true);
  }
}
Program: 141772
Project: 141772
Buggy source:
@Override public List<ExportFileResource> getExportResources(ExportFileResource[] processes,String... codeOptions) throws ProcessorException {
  List<ExportFileResource> list=super.getExportResources(processes,codeOptions);
  String privatePackage="String_Node_Str", exportService="String_Node_Str";
  Iterator<ExportFileResource> it=list.iterator();
  while (it.hasNext()) {
    ExportFileResource resource=it.next();
    if ("String_Node_Str".equals(resource.getDirectoryName())) {
      Map<String,Set<URL>> newResourcesMap=new HashMap<String,Set<URL>>();
      for (      String path : resource.getRelativePathList()) {
        if (path.startsWith("String_Node_Str")) {
          Set<URL> urls=resource.getResourcesByRelativePath(path);
          newResourcesMap.put("String_Node_Str" + path,urls);
        }
      }
      resource.removeAllMap();
      for (      String path : newResourcesMap.keySet()) {
        resource.addResources(path,new ArrayList<URL>(newResourcesMap.get(path)));
      }
    }
 else     if (LIBRARY_FOLDER_NAME.equals(resource.getDirectoryName())) {
      resource.setDirectoryName("String_Node_Str");
    }
 else     if (META_INF.equals(resource.getDirectoryName())) {
      it.remove();
      if (!resource.getAllResources().isEmpty()) {
        Set<URL> urls=resource.getAllResources().iterator().next();
        if (!urls.isEmpty()) {
          URL manifestURL=urls.iterator().next();
          try {
            File manifestFile=new File(manifestURL.toURI());
            FileInputStream fis=new FileInputStream(manifestFile);
            Manifest manifest=new Manifest(fis);
            exportService=manifest.getMainAttributes().getValue("String_Node_Str");
            privatePackage=manifest.getMainAttributes().getValue("String_Node_Str");
            fis.close();
          }
 catch (          URISyntaxException e) {
            ExceptionHandler.process(e);
          }
catch (          FileNotFoundException e) {
            ExceptionHandler.process(e);
          }
catch (          IOException e) {
            ExceptionHandler.process(e);
          }
        }
      }
    }
  }
  addSourceCodeToExport(list,processes,codeOptions);
  addMavenScriptToExport(list,processes,privatePackage,exportService);
  addKarFileToExport(list);
  addFeatureFileToExport(list,processes);
  return list;
}

Fixed version (ground truth):
@Override public List<ExportFileResource> getExportResources(ExportFileResource[] processes,String... codeOptions) throws ProcessorException {
  List<ExportFileResource> list=super.getExportResources(processes,codeOptions);
  addKarFileToExport(list);
  addFeatureFileToExport(list,processes);
  return list;
}
Program: 141774
Project: 141774
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  this.selection=selection;
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
    if (canWork) {
      canWork=isLastVersion(node);
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  this.selection=selection;
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
  }
  setEnabled(canWork);
}
Program: 141775
Project: 141775
Buggy source:
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    return;
  }
  this.setText(createLabel);
  this.setImageDescriptor(ImageProvider.getImageDesc(EServiceCoreImage.SERVICE_ICON));
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    creation=false;
  break;
default :
return;
}
setEnabled(true);
}

Fixed version (ground truth):
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    return;
  }
  this.setText(createLabel);
  this.setImageDescriptor(ImageProvider.getImageDesc(EServiceCoreImage.SERVICE_ICON));
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    creation=false;
  break;
default :
return;
}
setEnabled(isLastVersion(node));
}
Program: 141776
Project: 141776
Buggy source:
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    return;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    break;
default :
  return;
}
boolean flag=true;
if (node.getObject() == null) {
flag=false;
}
setEnabled(flag);
}

Fixed version (ground truth):
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    return;
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    break;
default :
  return;
}
boolean flag=true;
if (node.getObject() == null) {
flag=false;
}
if (flag) {
flag=isLastVersion(node);
}
setEnabled(flag);
}
Program: 141777
Project: 141777
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  this.selection=selection;
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=(List<RepositoryNode>)selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  this.selection=selection;
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=(List<RepositoryNode>)selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
    if (canWork) {
      canWork=isLastVersion(node);
    }
  }
  setEnabled(canWork);
}
Program: 141778
Project: 141778
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=(List<RepositoryNode>)selection.toList();
  for (  RepositoryNode node : nodes) {
    if ((node.getType() != ENodeType.REPOSITORY_ELEMENT) || (node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) || (node.getObject() == null)|| (ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED)) {
      canWork=false;
      break;
    }
 else {
      this.selection=selection;
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=(List<RepositoryNode>)selection.toList();
  for (  RepositoryNode node : nodes) {
    if ((node.getType() != ENodeType.REPOSITORY_ELEMENT) || (node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) || (node.getObject() == null)|| (ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED)) {
      canWork=false;
      break;
    }
 else {
      this.selection=selection;
    }
    if (canWork) {
      canWork=isLastVersion(node);
    }
  }
  setEnabled(canWork);
}
Program: 141780
Project: 141780
Buggy source:
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    return;
  }
  this.setText(createLabel);
  this.setImageDescriptor(ImageProvider.getImageDesc(EServiceCoreImage.SERVICE_ICON));
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    creation=false;
  break;
default :
return;
}
setEnabled(true);
}

Fixed version (ground truth):
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    return;
  }
  this.setText(createLabel);
  this.setImageDescriptor(ImageProvider.getImageDesc(EServiceCoreImage.SERVICE_ICON));
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    creation=false;
  break;
default :
return;
}
setEnabled(isLastVersion(node));
}
Program: 141781
Project: 141781
Buggy source:
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    return;
  }
  ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    break;
default :
  return;
}
boolean flag=true;
if (node.getObject() == null) {
flag=false;
}
setEnabled(flag);
}

Fixed version (ground truth):
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    return;
  }
  ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    break;
default :
  return;
}
boolean flag=true;
if (node.getObject() == null) {
flag=false;
}
if (flag) {
flag=isLastVersion(node);
}
setEnabled(flag);
}
Program: 141782
Project: 141782
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  this.selection=selection;
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  this.selection=selection;
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
    if (canWork) {
      canWork=isLastVersion(node);
    }
  }
  setEnabled(canWork);
}
Program: 141783
Project: 141783
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=(List<RepositoryNode>)selection.toList();
  for (  RepositoryNode node : nodes) {
    if ((node.getType() != ENodeType.REPOSITORY_ELEMENT) || (node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) || (node.getObject() == null)|| (ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED)) {
      canWork=false;
      break;
    }
 else {
      this.selection=selection;
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=(List<RepositoryNode>)selection.toList();
  for (  RepositoryNode node : nodes) {
    if ((node.getType() != ENodeType.REPOSITORY_ELEMENT) || (node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) || (node.getObject() == null)|| (ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED)) {
      canWork=false;
      break;
    }
 else {
      this.selection=selection;
    }
    if (canWork) {
      canWork=isLastVersion(node);
    }
  }
  setEnabled(canWork);
}
Program: 141784
Project: 141784
Buggy source:
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    return;
  }
  this.setText(createLabel);
  this.setImageDescriptor(ImageProvider.getImageDesc(EServiceCoreImage.SERVICE_ICON));
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    creation=false;
  break;
default :
return;
}
setEnabled(true);
}

Fixed version (ground truth):
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    return;
  }
  this.setText(createLabel);
  this.setImageDescriptor(ImageProvider.getImageDesc(EServiceCoreImage.SERVICE_ICON));
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    creation=false;
  break;
default :
return;
}
setEnabled(isLastVersion(node));
}
Program: 141785
Project: 141785
Buggy source:
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    return;
  }
  ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    break;
default :
  return;
}
boolean flag=true;
if (node.getObject() == null) {
flag=false;
}
setEnabled(flag);
}

Fixed version (ground truth):
@Override protected void init(RepositoryNode node){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  if (!currentNodeType.equals(nodeType)) {
    return;
  }
  ProxyRepositoryFactory.getInstance();
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    break;
default :
  return;
}
boolean flag=true;
if (node.getObject() == null) {
flag=false;
}
if (flag) {
flag=isLastVersion(node);
}
setEnabled(flag);
}
Program: 141786
Project: 141786
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  this.selection=selection;
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  this.selection=selection;
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
    if (canWork) {
      canWork=isLastVersion(node);
    }
  }
  setEnabled(canWork);
}
Program: 141787
Project: 141787
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=(List<RepositoryNode>)selection.toList();
  for (  RepositoryNode node : nodes) {
    if ((node.getType() != ENodeType.REPOSITORY_ELEMENT) || (node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) || (node.getObject() == null)|| (ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED)) {
      canWork=false;
      break;
    }
 else {
      this.selection=selection;
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=selection.toList();
  for (  RepositoryNode node : nodes) {
    if ((node.getType() != ENodeType.REPOSITORY_ELEMENT) || (node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) || (node.getObject() == null)|| (ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED)) {
      canWork=false;
      break;
    }
 else {
      this.selection=selection;
    }
    if (canWork) {
      canWork=isLastVersion(node);
    }
  }
  setEnabled(canWork);
}
Program: 141788
Project: 141788
Buggy source:
protected void doRun(){
  IWorkbenchWindow window=getWorkbenchWindow();
  ServiceItem serviceItem=null;
  List<RepositoryNode> nodes=(List<RepositoryNode>)selection.toList();
  for (  RepositoryNode node : nodes) {
    serviceItem=(ServiceItem)node.getObject().getProperty().getItem();
    ServiceConnection serviceConnection=(ServiceConnection)serviceItem.getConnection();
    Dialog dialog=new ServiceMetadataDialog(window,serviceItem,serviceConnection);
    dialog.open();
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  IWorkbenchWindow window=getWorkbenchWindow();
  ServiceItem serviceItem=null;
  List<RepositoryNode> nodes=selection.toList();
  for (  RepositoryNode node : nodes) {
    serviceItem=(ServiceItem)node.getObject().getProperty().getItem();
    ServiceConnection serviceConnection=(ServiceConnection)serviceItem.getConnection();
    Dialog dialog=new ServiceMetadataDialog(window,serviceItem,serviceConnection);
    dialog.open();
  }
}
Program: 141789
Project: 141789
Buggy source:
public boolean isVisible(){
  return isEnabled();
}

Fixed version (ground truth):
@Override public boolean isVisible(){
  return isEnabled();
}
Program: 141790
Project: 141790
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  this.selection=selection;
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
    if (canWork) {
      canWork=isLastVersion(node);
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  this.selection=selection;
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
  }
  setEnabled(canWork);
}
Program: 141791
Project: 141791
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  this.selection=selection;
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=(List<RepositoryNode>)selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
    if (canWork) {
      canWork=isLastVersion(node);
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty() || (selection.size() > 1)) {
    setEnabled(false);
    return;
  }
  this.selection=selection;
  @SuppressWarnings("String_Node_Str") List<RepositoryNode> nodes=(List<RepositoryNode>)selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT || node.getProperties(EProperties.CONTENT_TYPE) != ESBRepositoryNodeType.SERVICES) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
  }
  setEnabled(canWork);
}