Program: 136850
Project: 136850
Buggy source:
@Override public void retrieveUninstalledExtraFeatures(IProgressMonitor monitor,Set<ExtraFeature> uninstalledExtraFeatures) throws Exception {
  Bundle bundle=Platform.getBundle(getPluginName());
  if (bundle == null) {
    String pathToStore=Platform.getInstallLocation().getURL().getFile() + "String_Node_Str";
    File jarfile=new File(pathToStore,getJarFileWithVersionNames().get(0));
    if (jarfile.exists()) {
      return;
    }
 else {
      SubMonitor mainSubMonitor=SubMonitor.convert(monitor,2);
      List<ModuleNeeded> allUninstalledModules=getAllUninstalledModules();
      if (monitor.isCanceled()) {
        return;
      }
      ArrayList<ModuleToInstall> modulesRequiredToBeInstalled=new ArrayList<ModuleToInstall>();
      IRunnableWithProgress notInstalledModulesRunnable=RemoteModulesHelper.getInstance().getNotInstalledModulesRunnable(allUninstalledModules,modulesRequiredToBeInstalled);
      runNotInstallModule(mainSubMonitor,notInstalledModulesRunnable);
      if (mainSubMonitor.isCanceled()) {
        return;
      }
      ArrayList<ModuleToInstall> modulesForAutomaticInstall=TalendWebServiceUpdateExtraFeature.filterAllAutomaticInstallableModules(modulesRequiredToBeInstalled);
      if (modulesForAutomaticInstall.isEmpty()) {
        log.error("String_Node_Str" + getJarFileNames().get(0));
        return;
      }
      addToSet(uninstalledExtraFeatures,new TalendWebServiceUpdateExtraFeature(modulesForAutomaticInstall,DefaultMessagesImpl.getString(getDownloadName()),DefaultMessagesImpl.getString("String_Node_Str",getContainPluginNames()),true){
        @Override public IStatus install(        IProgressMonitor progress,        List<URI> allRepoUris) throws Exception {
          IStatus installStatus=super.install(progress,allRepoUris);
          if (installStatus.isOK()) {
            try {
              moveJars();
            }
 catch (            MalformedURLException e) {
              MultiStatus multiStatus=new MultiStatus(CorePlugin.PLUGIN_ID,IStatus.ERROR,e.getMessage(),e);
              multiStatus.add(installStatus);
              return multiStatus;
            }
catch (            IOException e) {
              MultiStatus multiStatus=new MultiStatus(CorePlugin.PLUGIN_ID,IStatus.ERROR,e.getMessage(),e);
              multiStatus.add(installStatus);
              return multiStatus;
            }
          }
          return installStatus;
        }
        private void moveJars() throws MalformedURLException, IOException {
          List<File> jarFiles=new ArrayList<File>();
          IMaven maven=MavenPlugin.getMaven();
          String librariesPath=maven.getLocalRepositoryPath();
          for (          String jarFileName : getJarFileWithVersionNames()) {
            jarFiles.addAll(FilesUtils.getJarFilesFromFolder(new File(librariesPath),jarFileName));
          }
          for (          File jarFile : jarFiles) {
            String pluginPath=Platform.getInstallLocation().getURL().getFile() + "String_Node_Str";
            File movedfile=new File(pluginPath,jarFile.getName());
            if (!movedfile.exists()) {
              File target=new File(StringUtils.trimToEmpty(pluginPath));
              if (!target.exists()) {
                target.mkdirs();
              }
              FilesUtils.copyFile(jarFile,movedfile);
            }
          }
        }
      }
);
    }
  }
 else {
  }
}

Fixed version (ground truth):
@Override public void retrieveUninstalledExtraFeatures(IProgressMonitor monitor,Set<ExtraFeature> uninstalledExtraFeatures) throws Exception {
  Bundle bundle=Platform.getBundle(getPluginName());
  if (bundle == null) {
    String pathToStore=Platform.getInstallLocation().getURL().getFile() + "String_Node_Str";
    File jarfile=new File(pathToStore,getJarFileWithVersionNames().get(0));
    if (jarfile.exists()) {
      return;
    }
 else {
      SubMonitor mainSubMonitor=SubMonitor.convert(monitor,2);
      List<ModuleNeeded> allUninstalledModules=getAllUninstalledModules();
      if (monitor.isCanceled()) {
        return;
      }
      ArrayList<ModuleToInstall> modulesRequiredToBeInstalled=new ArrayList<ModuleToInstall>();
      IRunnableWithProgress notInstalledModulesRunnable=RemoteModulesHelper.getInstance().getNotInstalledModulesRunnable(allUninstalledModules,modulesRequiredToBeInstalled);
      runNotInstallModule(mainSubMonitor,notInstalledModulesRunnable);
      if (mainSubMonitor.isCanceled()) {
        return;
      }
      final ArrayList<ModuleToInstall> modulesForAutomaticInstall=TalendWebServiceUpdateExtraFeature.filterAllAutomaticInstallableModules(modulesRequiredToBeInstalled);
      if (modulesForAutomaticInstall.isEmpty()) {
        log.error("String_Node_Str" + getJarFileNames().get(0));
        return;
      }
      addToSet(uninstalledExtraFeatures,new TalendWebServiceUpdateExtraFeature(modulesForAutomaticInstall,DefaultMessagesImpl.getString(getDownloadName()),DefaultMessagesImpl.getString("String_Node_Str",getContainPluginNames()),true){
        @Override public IStatus install(        IProgressMonitor progress,        List<URI> allRepoUris) throws Exception {
          IStatus installStatus=super.install(progress,allRepoUris);
          if (installStatus.isOK()) {
            try {
              copyJars2PluginsFolder(modulesForAutomaticInstall);
            }
 catch (            MalformedURLException e) {
              MultiStatus multiStatus=new MultiStatus(CorePlugin.PLUGIN_ID,IStatus.ERROR,e.getMessage(),e);
              multiStatus.add(installStatus);
              return multiStatus;
            }
catch (            IOException e) {
              MultiStatus multiStatus=new MultiStatus(CorePlugin.PLUGIN_ID,IStatus.ERROR,e.getMessage(),e);
              multiStatus.add(installStatus);
              return multiStatus;
            }
          }
          return installStatus;
        }
        private void copyJars2PluginsFolder(        ArrayList<ModuleToInstall> modules) throws MalformedURLException, IOException {
          List<File> jarFiles=new ArrayList<File>();
          ILibraryManagerService librariesService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
          if (librariesService != null) {
            for (            ModuleToInstall module : modules) {
              String snapshotUri=MavenUrlHelper.generateSnapshotMavenUri(module.getMavenUri());
              String jarPathFromMaven=librariesService.getJarPathFromMaven(snapshotUri);
              if (jarPathFromMaven == null) {
                continue;
              }
              jarFiles.add(new File(jarPathFromMaven));
            }
          }
 else {
            IMaven maven=MavenPlugin.getMaven();
            String librariesPath=maven.getLocalRepositoryPath();
            for (            String jarFileName : getJarFileWithVersionNames()) {
              jarFiles.addAll(FilesUtils.getJarFilesFromFolder(new File(librariesPath),jarFileName));
            }
          }
          for (          File jarFile : jarFiles) {
            String pluginPath=Platform.getInstallLocation().getURL().getFile() + "String_Node_Str";
            File movedfile=new File(pluginPath,jarFile.getName());
            if (!movedfile.exists()) {
              File target=new File(StringUtils.trimToEmpty(pluginPath));
              if (!target.exists()) {
                target.mkdirs();
              }
              FilesUtils.copyFile(jarFile,movedfile);
            }
          }
        }
      }
);
    }
  }
 else {
  }
}