nus-yam/ex-repair huggingface dataset:
Program: 62370
Project: 62370
Buggy source:
private static void checkoutRepository(Git repository,String branch,String username,String password){
  try {
    CheckoutCommand checkoutCommand=repository.checkout();
    checkoutCommand.setName(branch);
    Ref ref=checkoutCommand.call();
    if (ref == null || branch.equals(ref.getName())) {
      FetchCommand fetchCommand=repository.fetch();
      setCredentials(fetchCommand,username,password);
      fetchCommand.call();
      checkoutCommand=repository.checkout();
      checkoutCommand.setName(branch);
      checkoutCommand.call();
    }
  }
 catch (  GitAPIException e) {
    log.error("String_Node_Str",e);
    throw new GitException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private static void checkoutRepository(Git repository,String branch,String username,String password){
  try {
    CheckoutCommand checkoutCommand=repository.checkout();
    checkoutCommand.setName("String_Node_Str" + branch);
    Ref ref=checkoutCommand.call();
    if (ref == null || branch.equals(ref.getName())) {
      FetchCommand fetchCommand=repository.fetch();
      setCredentials(fetchCommand,username,password);
      fetchCommand.call();
      checkoutCommand=repository.checkout();
      checkoutCommand.setName("String_Node_Str" + branch);
      checkoutCommand.call();
    }
  }
 catch (  GitAPIException e) {
    log.error("String_Node_Str",e);
    throw new GitException("String_Node_Str",e);
  }
}
Program: 62371
Project: 62371
Buggy source:
@Then("String_Node_Str") public void i_can_find_a_GIT_repository_with_url_usr_pwd_stored_and_locations(String url,String usr,String pwd,boolean stored,List<CsarGitCheckoutLocation> locations) throws Throwable {
  CsarGitRepository csarGitRepository=getCsarGitRepository(url);
  Assert.assertNotNull(csarGitRepository);
  Comparator<CsarGitCheckoutLocation> comparator=new Comparator<CsarGitCheckoutLocation>(){
    @Override public int compare(    CsarGitCheckoutLocation o1,    CsarGitCheckoutLocation o2){
      int bCompare=o1.getBranchId().compareTo(o2.getBranchId());
      if (bCompare != 0) {
        return bCompare;
      }
 else {
        return o1.getSubPath().compareTo(o2.getSubPath());
      }
    }
  }
;
  Assert.assertEquals(usr,csarGitRepository.getUsername());
  Assert.assertEquals(pwd,csarGitRepository.getPassword());
  Assert.assertEquals(stored,csarGitRepository.isStoredLocally());
  Assert.assertEquals(locations.size(),csarGitRepository.getImportLocations().size());
  csarGitRepository.getImportLocations().sort(comparator);
  List<CsarGitCheckoutLocation> expectedlocations=new ArrayList<CsarGitCheckoutLocation>(locations);
  expectedlocations.sort(comparator);
  for (int i=0; i < expectedlocations.size(); i++) {
    CsarGitCheckoutLocation expected=expectedlocations.get(i);
    CsarGitCheckoutLocation actual=csarGitRepository.getImportLocations().get(i);
    Assert.assertEquals(actual.getBranchId(),expected.getBranchId());
    Assert.assertEquals(actual.getSubPath(),expected.getSubPath());
  }
}

Fixed version (ground truth):
@Then("String_Node_Str") public void i_can_find_a_GIT_repository_with_url_usr_pwd_stored_and_locations(String url,String usr,String pwd,boolean stored,List<CsarGitCheckoutLocation> locations) throws Throwable {
  CsarGitRepository csarGitRepository=getCsarGitRepository(url);
  Assert.assertNotNull(csarGitRepository);
  Comparator<CsarGitCheckoutLocation> comparator=new Comparator<CsarGitCheckoutLocation>(){
    @Override public int compare(    CsarGitCheckoutLocation o1,    CsarGitCheckoutLocation o2){
      int bCompare=o1.getBranchId().compareTo(o2.getBranchId());
      if (bCompare != 0) {
        return bCompare;
      }
 else {
        return o1.getSubPath().compareTo(o2.getSubPath());
      }
    }
  }
;
  Assert.assertEquals(usr,csarGitRepository.getUsername());
  Assert.assertEquals(pwd,csarGitRepository.getPassword());
  Assert.assertEquals(stored,csarGitRepository.isStoredLocally());
  Assert.assertEquals(locations.size(),csarGitRepository.getImportLocations().size());
  Collections.sort(csarGitRepository.getImportLocations(),comparator);
  List<CsarGitCheckoutLocation> expectedlocations=new ArrayList<CsarGitCheckoutLocation>(locations);
  Collections.sort(expectedlocations,comparator);
  for (int i=0; i < expectedlocations.size(); i++) {
    CsarGitCheckoutLocation expected=expectedlocations.get(i);
    CsarGitCheckoutLocation actual=csarGitRepository.getImportLocations().get(i);
    Assert.assertEquals(actual.getBranchId(),expected.getBranchId());
    Assert.assertEquals(actual.getSubPath(),expected.getSubPath());
  }
}
Program: 62372
Project: 62372
Buggy source:
@Then("String_Node_Str") public void i_can_find_a_GIT_repository_with_url_usr_pwd_stored_and_locations(String url,String usr,String pwd,boolean stored,List<CsarGitCheckoutLocation> locations) throws Throwable {
  CsarGitRepository csarGitRepository=getCsarGitRepository(url);
  Assert.assertNotNull(csarGitRepository);
  Comparator<CsarGitCheckoutLocation> comparator=new Comparator<CsarGitCheckoutLocation>(){
    @Override public int compare(    CsarGitCheckoutLocation o1,    CsarGitCheckoutLocation o2){
      int bCompare=o1.getBranchId().compareTo(o2.getBranchId());
      if (bCompare != 0) {
        return bCompare;
      }
 else {
        return o1.getSubPath().compareTo(o2.getSubPath());
      }
    }
  }
;
  Assert.assertEquals(usr,csarGitRepository.getUsername());
  Assert.assertEquals(pwd,csarGitRepository.getPassword());
  Assert.assertEquals(stored,csarGitRepository.isStoredLocally());
  Assert.assertEquals(locations.size(),csarGitRepository.getImportLocations().size());
  csarGitRepository.getImportLocations().sort(comparator);
  List<CsarGitCheckoutLocation> expectedlocations=new ArrayList<CsarGitCheckoutLocation>(locations);
  expectedlocations.sort(comparator);
  for (int i=0; i < expectedlocations.size(); i++) {
    CsarGitCheckoutLocation expected=expectedlocations.get(i);
    CsarGitCheckoutLocation actual=csarGitRepository.getImportLocations().get(i);
    Assert.assertEquals(actual.getBranchId(),expected.getBranchId());
    Assert.assertEquals(actual.getSubPath(),expected.getSubPath());
  }
}

Fixed version (ground truth):
@Then("String_Node_Str") public void i_can_find_a_GIT_repository_with_url_usr_pwd_stored_and_locations(String url,String usr,String pwd,boolean stored,List<CsarGitCheckoutLocation> locations) throws Throwable {
  CsarGitRepository csarGitRepository=getCsarGitRepository(url);
  Assert.assertNotNull(csarGitRepository);
  Comparator<CsarGitCheckoutLocation> comparator=new Comparator<CsarGitCheckoutLocation>(){
    @Override public int compare(    CsarGitCheckoutLocation o1,    CsarGitCheckoutLocation o2){
      int bCompare=o1.getBranchId().compareTo(o2.getBranchId());
      if (bCompare != 0) {
        return bCompare;
      }
 else {
        return o1.getSubPath().compareTo(o2.getSubPath());
      }
    }
  }
;
  Assert.assertEquals(usr,csarGitRepository.getUsername());
  Assert.assertEquals(pwd,csarGitRepository.getPassword());
  Assert.assertEquals(stored,csarGitRepository.isStoredLocally());
  Assert.assertEquals(locations.size(),csarGitRepository.getImportLocations().size());
  Collections.sort(csarGitRepository.getImportLocations(),comparator);
  List<CsarGitCheckoutLocation> expectedlocations=new ArrayList<CsarGitCheckoutLocation>(locations);
  Collections.sort(expectedlocations,comparator);
  for (int i=0; i < expectedlocations.size(); i++) {
    CsarGitCheckoutLocation expected=expectedlocations.get(i);
    CsarGitCheckoutLocation actual=csarGitRepository.getImportLocations().get(i);
    Assert.assertEquals(actual.getBranchId(),expected.getBranchId());
    Assert.assertEquals(actual.getSubPath(),expected.getSubPath());
  }
}
Program: 62374
Project: 62374
Buggy source:
private boolean isTemplatePropertiesMatchCandidateFilters(NodeTemplate nodeTemplate,MatchingConfiguration matchingConfiguration,LocationResourceTemplate candidate,IndexedNodeType candidateType,Map<String,IndexedCapabilityType> capabilityTypes){
  if (!isTemplatePropertiesMatchCandidateFilter(nodeTemplate.getProperties(),matchingConfiguration.getProperties(),candidate.getTemplate().getProperties(),candidateType.getProperties())) {
    return false;
  }
  for (  Map.Entry<String,MatchingFilterDefinition> capabilityMatchingFilterEntry : matchingConfiguration.getCapabilities().entrySet()) {
    FilterDefinition filterDefinition=new FilterDefinition();
    Capability candidateCapability=candidate.getTemplate().getCapabilities().get(capabilityMatchingFilterEntry.getKey());
    IndexedCapabilityType capabilityType=capabilityTypes.get(candidateCapability.getType());
    Capability templateCapability=nodeTemplate.getCapabilities().get(capabilityMatchingFilterEntry.getKey());
    if (!isTemplatePropertiesMatchCandidateFilter(templateCapability.getProperties(),capabilityMatchingFilterEntry.getValue().getProperties(),candidateCapability.getProperties(),capabilityType.getProperties())) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean isTemplatePropertiesMatchCandidateFilters(NodeTemplate nodeTemplate,MatchingConfiguration matchingConfiguration,LocationResourceTemplate candidate,IndexedNodeType candidateType,Map<String,IndexedCapabilityType> capabilityTypes){
  if (!isTemplatePropertiesMatchCandidateFilter(nodeTemplate.getProperties(),matchingConfiguration.getProperties(),candidate.getTemplate().getProperties(),candidateType.getProperties())) {
    return false;
  }
  for (  Map.Entry<String,MatchingFilterDefinition> capabilityMatchingFilterEntry : matchingConfiguration.getCapabilities().entrySet()) {
    FilterDefinition filterDefinition=new FilterDefinition();
    Capability candidateCapability=candidate.getTemplate().getCapabilities().get(capabilityMatchingFilterEntry.getKey());
    IndexedCapabilityType capabilityType=capabilityTypes.get(candidateCapability.getType());
    Capability templateCapability=nodeTemplate.getCapabilities().get(capabilityMatchingFilterEntry.getKey());
    if (templateCapability != null && !isTemplatePropertiesMatchCandidateFilter(templateCapability.getProperties(),capabilityMatchingFilterEntry.getValue().getProperties(),candidateCapability.getProperties(),capabilityType.getProperties())) {
      return false;
    }
  }
  return true;
}
Program: 62375
Project: 62375
Buggy source:
/** 
 * @param wf
 * @param relatedStepId if specified, the step will be added near this one (maybe before)
 * @param before if true, the step will be added before the relatedStepId
 * @param activity
 */
public void addActivity(Workflow wf,String relatedStepId,boolean before,AbstractActivity activity,TopologyContext topologyContext){
  if (WorkflowUtils.isNativeNode(activity.getNodeId(),topologyContext)) {
    throw new BadWorkflowOperationException("String_Node_Str");
  }
  if (relatedStepId != null) {
    if (before) {
      insertActivityStep(wf,relatedStepId,activity);
    }
 else {
      appendActivityStep(wf,relatedStepId,activity);
    }
  }
 else {
    addActivityStep(wf,activity.getNodeId(),activity);
  }
}

Fixed version (ground truth):
/** 
 * @param wf
 * @param relatedStepId if specified, the step will be added near this one (maybe before)
 * @param before if true, the step will be added before the relatedStepId
 * @param activity
 */
public void addActivity(Workflow wf,String relatedStepId,boolean before,AbstractActivity activity,TopologyContext topologyContext){
  if (WorkflowUtils.isNativeOrSubstitutionNode(activity.getNodeId(),topologyContext)) {
    throw new BadWorkflowOperationException("String_Node_Str");
  }
  if (relatedStepId != null) {
    if (before) {
      insertActivityStep(wf,relatedStepId,activity);
    }
 else {
      appendActivityStep(wf,relatedStepId,activity);
    }
  }
 else {
    addActivityStep(wf,activity.getNodeId(),activity);
  }
}
Program: 62378
Project: 62378
Buggy source:
@Override public void addNode(Workflow wf,String nodeId,TopologyContext toscaTypeFinder,boolean isCompute){
  if (WorkflowUtils.isNativeNode(nodeId,toscaTypeFinder)) {
    WorkflowUtils.addDelegateWorkflowStep(wf,nodeId);
  }
 else {
    AbstractStep lastStep=null;
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.STOPPING);
    lastStep=eventuallyAddStdOperationStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.STOP,toscaTypeFinder,false);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.STOPPED);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.DELETING);
    lastStep=eventuallyAddStdOperationStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.DELETE,toscaTypeFinder,false);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.DELETED);
  }
}

Fixed version (ground truth):
@Override public void addNode(Workflow wf,String nodeId,TopologyContext toscaTypeFinder,boolean isCompute){
  if (WorkflowUtils.isNativeOrSubstitutionNode(nodeId,toscaTypeFinder)) {
    WorkflowUtils.addDelegateWorkflowStep(wf,nodeId);
  }
 else {
    AbstractStep lastStep=null;
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.STOPPING);
    lastStep=eventuallyAddStdOperationStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.STOP,toscaTypeFinder,false);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.STOPPED);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.DELETING);
    lastStep=eventuallyAddStdOperationStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.DELETE,toscaTypeFinder,false);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.DELETED);
  }
}
Program: 62379
Project: 62379
Buggy source:
@Override public void addRelationship(Workflow wf,String nodeId,NodeTemplate nodeTemplate,RelationshipTemplate relationshipTemplate,TopologyContext toscaTypeFinder){
  IndexedRelationshipType indexedRelationshipType=toscaTypeFinder.findElement(IndexedRelationshipType.class,relationshipTemplate.getType());
  String targetId=relationshipTemplate.getTarget();
  boolean targetIsNative=WorkflowUtils.isNativeNode(targetId,toscaTypeFinder);
  if (targetIsNative || WorkflowUtils.isOfType(indexedRelationshipType,NormativeRelationshipConstants.HOSTED_ON)) {
    String parentId=WorkflowUtils.getParentId(wf,nodeId,toscaTypeFinder);
    NodeActivityStep deletedSourceStep=WorkflowUtils.getStateStepByNode(wf,nodeId,ToscaNodeLifecycleConstants.DELETED);
    AbstractStep targetStep=null;
    if (targetIsNative) {
      targetStep=WorkflowUtils.getDelegateWorkflowStepByNode(wf,targetId);
    }
 else {
      targetStep=WorkflowUtils.getStateStepByNode(wf,parentId,ToscaNodeLifecycleConstants.STOPPING);
    }
    WorkflowUtils.linkSteps(deletedSourceStep,targetStep);
  }
}

Fixed version (ground truth):
@Override public void addRelationship(Workflow wf,String nodeId,NodeTemplate nodeTemplate,RelationshipTemplate relationshipTemplate,TopologyContext toscaTypeFinder){
  IndexedRelationshipType indexedRelationshipType=toscaTypeFinder.findElement(IndexedRelationshipType.class,relationshipTemplate.getType());
  String targetId=relationshipTemplate.getTarget();
  boolean targetIsNative=WorkflowUtils.isNativeOrSubstitutionNode(targetId,toscaTypeFinder);
  if (targetIsNative || WorkflowUtils.isOfType(indexedRelationshipType,NormativeRelationshipConstants.HOSTED_ON)) {
    String parentId=WorkflowUtils.getParentId(wf,nodeId,toscaTypeFinder);
    NodeActivityStep deletedSourceStep=WorkflowUtils.getStateStepByNode(wf,nodeId,ToscaNodeLifecycleConstants.DELETED);
    AbstractStep targetStep=null;
    if (targetIsNative) {
      targetStep=WorkflowUtils.getDelegateWorkflowStepByNode(wf,targetId);
    }
 else {
      targetStep=WorkflowUtils.getStateStepByNode(wf,parentId,ToscaNodeLifecycleConstants.STOPPING);
    }
    WorkflowUtils.linkSteps(deletedSourceStep,targetStep);
  }
}
Program: 62380
Project: 62380
Buggy source:
@Override public ArtifactSupport getArtifactSupport(){
  return new ArtifactSupport(new String[]{"String_Node_Str"});
}

Fixed version (ground truth):
@Override public ArtifactSupport getArtifactSupport(){
  return new ArtifactSupport(new String[]{"String_Node_Str","String_Node_Str"});
}
Program: 62381
Project: 62381
Buggy source:
@When("String_Node_Str") public void I_define_the_property_of_capability_the_node_as_input_property(String propertyId,String capabilityId,String nodeTemplateId,String inputId) throws Throwable {
  String url=String.format("String_Node_Str",Context.getInstance().getTopologyId(),nodeTemplateId,capabilityId,propertyId);
  List<NameValuePair> nvps=new ArrayList<NameValuePair>();
  nvps.add(new BasicNameValuePair("String_Node_Str",inputId));
  Context.getInstance().registerRestResponse(Context.getRestClientInstance().postUrlEncoded(url,nvps));
}

Fixed version (ground truth):
@When("String_Node_Str") public void I_define_the_property_of_capability_the_node_as_input_property(String propertyId,String capabilityId,String nodeTemplateId,String inputId) throws Throwable {
  String url=String.format("String_Node_Str",Context.getInstance().getTopologyId(),nodeTemplateId,capabilityId,propertyId);
  List<NameValuePair> nvps=new ArrayList<NameValuePair>();
  nvps.add(new BasicNameValuePair("String_Node_Str",inputId));
  String response=Context.getRestClientInstance().postUrlEncoded(url,nvps);
  Context.getInstance().registerRestResponse(response);
}
Program: 62382
Project: 62382
Buggy source:
/** 
 * Search in the given path for folders that contains CloudServiceArchives and zip them so they.
 * @param searchPath The path in which to search for archives.
 * @return a list of path that contains archives.
 */
public Set<Path> prepare(Path searchPath,Path zipPath){
  ToscaFinderWalker toscaFinderWalker=new ToscaFinderWalker();
  toscaFinderWalker.zipRootPath=zipPath;
  toscaFinderWalker.rootPath=searchPath;
  try {
    Files.walkFileTree(searchPath,toscaFinderWalker);
  }
 catch (  IOException e) {
    throw new GitException("String_Node_Str",e);
  }
  return toscaFinderWalker.toscaArchives;
}

Fixed version (ground truth):
/** 
 * Search in the given path for folders that contains CloudServiceArchives and zip them so they.
 * @param searchPath The path in which to search for archives.
 * @return a list of path that contains archives.
 */
public Set<Path> prepare(Path searchPath,Path zipPath,String subpath){
  ToscaFinderWalker toscaFinderWalker=new ToscaFinderWalker();
  toscaFinderWalker.zipRootPath=zipPath;
  toscaFinderWalker.rootPath=searchPath;
  toscaFinderWalker.subpath=subpath;
  try {
    Files.walkFileTree(searchPath,toscaFinderWalker);
  }
 catch (  IOException e) {
    throw new GitException("String_Node_Str",e);
  }
  return toscaFinderWalker.toscaArchives;
}
Program: 62383
Project: 62383
Buggy source:
private void addToscaArchive(Path path){
  Path relativePath=rootPath.relativize(path);
  Path zipPath=zipRootPath.resolve(relativePath).resolve("String_Node_Str");
  try {
    if (Files.exists(zipPath)) {
      FileUtil.delete(zipPath);
    }
    FileUtil.zip(path,zipPath);
    toscaArchives.add(zipPath);
  }
 catch (  IOException e) {
    throw new GitException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void addToscaArchive(Path path){
  if (!(Strings.isNullOrEmpty(subpath) || path.endsWith(subpath))) {
    return;
  }
  Path relativePath=rootPath.relativize(path);
  Path zipPath=zipRootPath.resolve(relativePath).resolve("String_Node_Str");
  try {
    if (Files.exists(zipPath)) {
      FileUtil.delete(zipPath);
    }
    FileUtil.zip(path,zipPath);
    toscaArchives.add(zipPath);
  }
 catch (  IOException e) {
    throw new GitException("String_Node_Str",e);
  }
}
Program: 62384
Project: 62384
Buggy source:
private void validatesRepositoryUrl(String repositoryUrl){
  if (!UrlUtil.isValid(repositoryUrl)) {
    throw new InvalidArgumentException("String_Node_Str" + repositoryUrl + "String_Node_Str");
  }
  if (alienDAO.customFind(CsarGitRepository.class,QueryBuilders.termQuery(URL_FIELD,repositoryUrl)) != null) {
    throw new AlreadyExistException("String_Node_Str" + repositoryUrl + "String_Node_Str");
  }
}

Fixed version (ground truth):
private void validatesRepositoryUrl(String repositoryUrl,String id){
  if (!UrlUtil.isValid(repositoryUrl)) {
    throw new InvalidArgumentException("String_Node_Str" + repositoryUrl + "String_Node_Str");
  }
  CsarGitRepository existingCsarGitRepository=alienDAO.customFind(CsarGitRepository.class,QueryBuilders.termQuery(URL_FIELD,repositoryUrl));
  if (existingCsarGitRepository == null) {
    return;
  }
 else   if (id == null || !id.equals(existingCsarGitRepository.getId())) {
    throw new AlreadyExistException("String_Node_Str" + repositoryUrl + "String_Node_Str");
  }
}
Program: 62385
Project: 62385
Buggy source:
/** 
 * Create a CsarGitRepository in the system to store its informations
 * @param repositoryUrl The unique Git url of the CsarGitRepository
 * @param username The username of the user
 * @param password The password of the user
 * @param importLocations Locations where Csar's files are store
 * @param isStoredLocally The state of the the CsarGitRepository
 * @return The auto-generated id of the CsarGitRepository object
 */
public String create(String repositoryUrl,String username,String password,List<CsarGitCheckoutLocation> importLocations,boolean isStoredLocally){
  validatesRepositoryUrl(repositoryUrl);
  if (importLocations.isEmpty()) {
    throw new InvalidArgumentException("String_Node_Str");
  }
  CsarGitRepository csarGit=new CsarGitRepository();
  csarGit.setId(UUID.randomUUID().toString());
  csarGit.setRepositoryUrl(repositoryUrl);
  csarGit.setUsername(username);
  csarGit.setPassword(password);
  csarGit.setImportLocations(importLocations);
  csarGit.setStoredLocally(isStoredLocally);
  alienDAO.save(csarGit);
  return csarGit.getId();
}

Fixed version (ground truth):
/** 
 * Create a CsarGitRepository in the system to store its informations
 * @param repositoryUrl The unique Git url of the CsarGitRepository
 * @param username The username of the user
 * @param password The password of the user
 * @param importLocations Locations where Csar's files are store
 * @param isStoredLocally The state of the the CsarGitRepository
 * @return The auto-generated id of the CsarGitRepository object
 */
public String create(String repositoryUrl,String username,String password,List<CsarGitCheckoutLocation> importLocations,boolean isStoredLocally){
  validatesRepositoryUrl(repositoryUrl,null);
  if (importLocations.isEmpty()) {
    throw new InvalidArgumentException("String_Node_Str");
  }
  CsarGitRepository csarGit=new CsarGitRepository();
  csarGit.setId(UUID.randomUUID().toString());
  csarGit.setRepositoryUrl(repositoryUrl);
  csarGit.setUsername(username);
  csarGit.setPassword(password);
  csarGit.setImportLocations(importLocations);
  csarGit.setStoredLocally(isStoredLocally);
  alienDAO.save(csarGit);
  return csarGit.getId();
}
Program: 62386
Project: 62386
Buggy source:
/** 
 * Update informations for a given CsarGitRepository.
 * @param idOrUrl The id or url of the CsarGitRepository to update.
 * @param repositoryUrl The new url of the CsarGitRepository
 * @param username The username associated to the CsarGitRepository
 * @param password The password associated to the CsarGitRepository
 */
public void update(String idOrUrl,String repositoryUrl,String username,String password){
  CsarGitRepository repositoryToUpdate=getOrFail(idOrUrl);
  if (repositoryUrl != null) {
    validatesRepositoryUrl(repositoryUrl);
    repositoryToUpdate.setRepositoryUrl(repositoryUrl);
  }
  if (username != null) {
    repositoryToUpdate.setUsername(username);
  }
  if (password != null) {
    repositoryToUpdate.setPassword(password);
  }
  alienDAO.save(repositoryToUpdate);
}

Fixed version (ground truth):
/** 
 * Update informations for a given CsarGitRepository.
 * @param idOrUrl The id or url of the CsarGitRepository to update.
 * @param repositoryUrl The new url of the CsarGitRepository
 * @param username The username associated to the CsarGitRepository
 * @param password The password associated to the CsarGitRepository
 */
public void update(String id,String repositoryUrl,String username,String password,List<CsarGitCheckoutLocation> importLocations,boolean isStoredLocally){
  validatesRepositoryUrl(repositoryUrl,id);
  CsarGitRepository repositoryToUpdate=getOrFail(id);
  repositoryToUpdate.setRepositoryUrl(repositoryUrl);
  if (username != null) {
    repositoryToUpdate.setUsername(username);
  }
  if (password != null) {
    repositoryToUpdate.setPassword(password);
  }
  repositoryToUpdate.setStoredLocally(isStoredLocally);
  for (  CsarGitCheckoutLocation location : importLocations) {
    CsarGitCheckoutLocation existingLocation=findLocationIn(location,repositoryToUpdate.getImportLocations());
    if (existingLocation != null) {
      location.setLastImportedHash(existingLocation.getLastImportedHash());
    }
  }
  repositoryToUpdate.setImportLocations(importLocations);
  alienDAO.save(repositoryToUpdate);
}
Program: 62387
Project: 62387
Buggy source:
private List<ParsingResult<Csar>> processImport(CsarGitRepository csarGitRepository,CsarGitCheckoutLocation csarGitCheckoutLocation,String gitHash){
  Path archiveZipRoot=tempZipDirPath.resolve(csarGitRepository.getId());
  Path archiveGitRoot=tempDirPath.resolve(csarGitRepository.getId());
  Set<Path> archivePaths=csarFinderService.prepare(archiveGitRoot,archiveZipRoot);
  List<ParsingResult<Csar>> parsingResult=Lists.newArrayList();
  try {
    Map<CSARDependency,CsarDependenciesBean> csarDependenciesBeans=uploadService.preParsing(archivePaths);
    List<CsarDependenciesBean> sorted=sort(csarDependenciesBeans);
    for (    CsarDependenciesBean csarBean : sorted) {
      if (csarGitCheckoutLocation.getLastImportedHash() != null && csarGitCheckoutLocation.getLastImportedHash().equals(gitHash)) {
        if (csarService.getIfExists(csarBean.getSelf().getName(),csarBean.getSelf().getVersion()) != null) {
          continue;
        }
      }
      ParsingResult<Csar> result=uploadService.upload(csarBean.getPath());
      parsingResult.add(result);
    }
    return parsingResult;
  }
 catch (  ParsingException e) {
    throw new GitException("String_Node_Str",e);
  }
catch (  CSARVersionAlreadyExistsException e) {
    return parsingResult;
  }
}

Fixed version (ground truth):
private List<ParsingResult<Csar>> processImport(CsarGitRepository csarGitRepository,CsarGitCheckoutLocation csarGitCheckoutLocation,String gitHash){
  Path archiveZipRoot=tempZipDirPath.resolve(csarGitRepository.getId());
  Path archiveGitRoot=tempDirPath.resolve(csarGitRepository.getId());
  Set<Path> archivePaths=csarFinderService.prepare(archiveGitRoot,archiveZipRoot,csarGitCheckoutLocation.getSubPath());
  List<ParsingResult<Csar>> parsingResult=Lists.newArrayList();
  try {
    Map<CSARDependency,CsarDependenciesBean> csarDependenciesBeans=uploadService.preParsing(archivePaths);
    List<CsarDependenciesBean> sorted=sort(csarDependenciesBeans);
    for (    CsarDependenciesBean csarBean : sorted) {
      if (csarGitCheckoutLocation.getLastImportedHash() != null && csarGitCheckoutLocation.getLastImportedHash().equals(gitHash)) {
        if (csarService.getIfExists(csarBean.getSelf().getName(),csarBean.getSelf().getVersion()) != null) {
          continue;
        }
      }
      ParsingResult<Csar> result=uploadService.upload(csarBean.getPath());
      parsingResult.add(result);
    }
    return parsingResult;
  }
 catch (  ParsingException e) {
    throw new GitException("String_Node_Str",e);
  }
catch (  CSARVersionAlreadyExistsException e) {
    return parsingResult;
  }
}
Program: 62388
Project: 62388
Buggy source:
public Map<CSARDependency,CsarDependenciesBean> preParsing(Set<Path> paths) throws ParsingException {
  Map<CSARDependency,CsarDependenciesBean> csarDependenciesBeans=Maps.newHashMap();
  for (  Path path : paths) {
    CsarDependenciesBean csarDepContainer=new CsarDependenciesBean();
    ParsingResult<ArchiveRoot> parsingResult=parser.parse(path);
    csarDepContainer.setPath(path);
    csarDepContainer.setSelf(new CSARDependency(parsingResult.getResult().getArchive().getName(),parsingResult.getResult().getArchive().getVersion()));
    csarDepContainer.setDependencies(parsingResult.getResult().getArchive().getDependencies());
    csarDependenciesBeans.put(csarDepContainer.getSelf(),csarDepContainer);
  }
  return csarDependenciesBeans;
}

Fixed version (ground truth):
public Map<CSARDependency,CsarDependenciesBean> preParsing(Set<Path> paths) throws ParsingException {
  Map<CSARDependency,CsarDependenciesBean> csarDependenciesBeans=Maps.newHashMap();
  for (  Path path : paths) {
    try {
      ParsingResult<ArchiveRoot> parsingResult=parser.parse(path);
      CsarDependenciesBean csarDepContainer=new CsarDependenciesBean();
      csarDepContainer.setPath(path);
      csarDepContainer.setSelf(new CSARDependency(parsingResult.getResult().getArchive().getName(),parsingResult.getResult().getArchive().getVersion()));
      csarDepContainer.setDependencies(parsingResult.getResult().getArchive().getDependencies());
      csarDependenciesBeans.put(csarDepContainer.getSelf(),csarDepContainer);
    }
 catch (    Exception e) {
      log.debug("String_Node_Str",e);
    }
  }
  return csarDependenciesBeans;
}
Program: 62389
Project: 62389
Buggy source:
/** 
 * Update an existing CsarGit by id
 * @param request The CsarGit data to update
 * @return an empty (void) rest {@link RestResponse}.
 */
@ApiOperation(value="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.PUT,consumes=MediaType.APPLICATION_JSON_VALUE) @PreAuthorize("String_Node_Str") @Audit public RestResponse<Void> update(@ApiParam(value="String_Node_Str",required=true) @PathVariable String id,@RequestBody UpdateCsarGitRequest request){
  csarGitRepositoryService.update(id,request.getRepositoryUrl(),request.getUsername(),request.getPassword());
  return RestResponseBuilder.<Void>builder().build();
}

Fixed version (ground truth):
/** 
 * Update an existing CsarGit by id
 * @param request The CsarGit data to update
 * @return an empty (void) rest {@link RestResponse}.
 */
@ApiOperation(value="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.PUT,consumes=MediaType.APPLICATION_JSON_VALUE) @PreAuthorize("String_Node_Str") @Audit public RestResponse<Void> update(@ApiParam(value="String_Node_Str",required=true) @PathVariable String id,@RequestBody CreateCsarGitRequest request){
  csarGitRepositoryService.update(id,request.getRepositoryUrl(),request.getUsername(),request.getPassword(),request.getImportLocations(),request.isStoredLocally());
  return RestResponseBuilder.<Void>builder().build();
}
Program: 62390
Project: 62390
Buggy source:
private static void checkoutRepository(Git repository,String branch,String username,String password){
  try {
    CheckoutCommand checkoutCommand=repository.checkout();
    checkoutCommand.setName(branch);
    Ref ref=checkoutCommand.call();
    if (branch.equals(ref.getName())) {
      FetchCommand fetchCommand=repository.fetch();
      setCredentials(fetchCommand,username,password);
      fetchCommand.call();
      checkoutCommand=repository.checkout();
      checkoutCommand.setName(branch);
      checkoutCommand.call();
    }
  }
 catch (  GitAPIException e) {
    log.error("String_Node_Str",e);
    throw new GitException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private static void checkoutRepository(Git repository,String branch,String username,String password){
  try {
    CheckoutCommand checkoutCommand=repository.checkout();
    checkoutCommand.setName(branch);
    Ref ref=checkoutCommand.call();
    if (ref == null || branch.equals(ref.getName())) {
      FetchCommand fetchCommand=repository.fetch();
      setCredentials(fetchCommand,username,password);
      fetchCommand.call();
      checkoutCommand=repository.checkout();
      checkoutCommand.setName(branch);
      checkoutCommand.call();
    }
  }
 catch (  GitAPIException e) {
    log.error("String_Node_Str",e);
    throw new GitException("String_Node_Str",e);
  }
}
Program: 62391
Project: 62391
Buggy source:
private void addToscaArchive(Path path){
  Path relativePath=rootPath.relativize(path);
  Path zipPath=zipRootPath.resolve(relativePath).resolve("String_Node_Str");
  try {
    FileUtil.zip(path,zipPath);
    toscaArchives.add(zipPath);
  }
 catch (  IOException e) {
    throw new GitException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void addToscaArchive(Path path){
  Path relativePath=rootPath.relativize(path);
  Path zipPath=zipRootPath.resolve(relativePath).resolve("String_Node_Str");
  try {
    if (Files.exists(zipPath)) {
      FileUtil.delete(zipPath);
    }
    FileUtil.zip(path,zipPath);
    toscaArchives.add(zipPath);
  }
 catch (  IOException e) {
    throw new GitException("String_Node_Str",e);
  }
}
Program: 62392
Project: 62392
Buggy source:
private List<ParsingResult<Csar>> processImport(CsarGitRepository csarGitRepository,CsarGitCheckoutLocation csarGitCheckoutLocation){
  Path archiveZipRoot=tempZipDirPath.resolve(csarGitRepository.getId());
  Path archiveGitRoot=tempDirPath.resolve(csarGitRepository.getId());
  Set<Path> archivePaths=csarFinderService.prepare(archiveGitRoot,archiveZipRoot);
  List<ParsingResult<Csar>> parsingResult=Lists.newArrayList();
  try {
    Map<CSARDependency,CsarDependenciesBean> csarDependenciesBeans=uploadService.preParsing(archivePaths);
    List<CsarDependenciesBean> sorted=sort(csarDependenciesBeans);
    for (    CsarDependenciesBean csarBean : sorted) {
      ParsingResult<Csar> result=uploadService.upload(csarBean.getPath());
      parsingResult.add(result);
    }
    return parsingResult;
  }
 catch (  ParsingException e) {
    throw new GitException("String_Node_Str",e);
  }
catch (  CSARVersionAlreadyExistsException e) {
    return parsingResult;
  }
}

Fixed version (ground truth):
private List<ParsingResult<Csar>> processImport(CsarGitRepository csarGitRepository,CsarGitCheckoutLocation csarGitCheckoutLocation,String gitHash){
  Path archiveZipRoot=tempZipDirPath.resolve(csarGitRepository.getId());
  Path archiveGitRoot=tempDirPath.resolve(csarGitRepository.getId());
  Set<Path> archivePaths=csarFinderService.prepare(archiveGitRoot,archiveZipRoot);
  List<ParsingResult<Csar>> parsingResult=Lists.newArrayList();
  try {
    Map<CSARDependency,CsarDependenciesBean> csarDependenciesBeans=uploadService.preParsing(archivePaths);
    List<CsarDependenciesBean> sorted=sort(csarDependenciesBeans);
    for (    CsarDependenciesBean csarBean : sorted) {
      if (csarGitCheckoutLocation.getLastImportedHash() != null && csarGitCheckoutLocation.getLastImportedHash().equals(gitHash)) {
        if (csarService.getIfExists(csarBean.getSelf().getName(),csarBean.getSelf().getVersion()) != null) {
          continue;
        }
      }
      ParsingResult<Csar> result=uploadService.upload(csarBean.getPath());
      parsingResult.add(result);
    }
    return parsingResult;
  }
 catch (  ParsingException e) {
    throw new GitException("String_Node_Str",e);
  }
catch (  CSARVersionAlreadyExistsException e) {
    return parsingResult;
  }
}
Program: 62393
Project: 62393
Buggy source:
private List<ParsingResult<Csar>> doImport(CsarGitRepository csarGitRepository,CsarGitCheckoutLocation csarGitCheckoutLocation){
  Git git=null;
  try {
    git=RepositoryManager.cloneOrCheckout(tempDirPath,csarGitRepository.getRepositoryUrl(),csarGitRepository.getUsername(),csarGitRepository.getPassword(),csarGitCheckoutLocation.getBranchId(),csarGitRepository.getId());
    if (csarGitRepository.isStoredLocally()) {
      RepositoryManager.pull(git,csarGitRepository.getUsername(),csarGitRepository.getPassword());
    }
    String hash=RepositoryManager.getLastHash(git);
    if (csarGitCheckoutLocation.getLastImportedHash() != null && csarGitCheckoutLocation.getLastImportedHash().equals(hash)) {
      return null;
    }
    List<ParsingResult<Csar>> results=processImport(csarGitRepository,csarGitCheckoutLocation);
    boolean updateHash=true;
    for (    ParsingResult<Csar> result : results) {
      if (ArchiveUploadService.hasError(result,ParsingErrorLevel.ERROR)) {
        updateHash=false;
      }
    }
    if (updateHash) {
      csarGitCheckoutLocation.setLastImportedHash(hash);
      alienDAO.save(csarGitRepository);
    }
    return results;
  }
  finally {
    if (git != null) {
      git.close();
    }
  }
}

Fixed version (ground truth):
private List<ParsingResult<Csar>> doImport(CsarGitRepository csarGitRepository,CsarGitCheckoutLocation csarGitCheckoutLocation){
  Git git=null;
  try {
    git=RepositoryManager.cloneOrCheckout(tempDirPath,csarGitRepository.getRepositoryUrl(),csarGitRepository.getUsername(),csarGitRepository.getPassword(),csarGitCheckoutLocation.getBranchId(),csarGitRepository.getId());
    if (csarGitRepository.isStoredLocally()) {
      RepositoryManager.pull(git,csarGitRepository.getUsername(),csarGitRepository.getPassword());
    }
    String hash=RepositoryManager.getLastHash(git);
    List<ParsingResult<Csar>> results=processImport(csarGitRepository,csarGitCheckoutLocation,hash);
    if (!Objects.equals(csarGitCheckoutLocation.getLastImportedHash(),hash)) {
      csarGitCheckoutLocation.setLastImportedHash(hash);
      alienDAO.save(csarGitRepository);
    }
    return results;
  }
  finally {
    if (git != null) {
      git.close();
    }
  }
}
Program: 62395
Project: 62395
Buggy source:
/** 
 * Get the list of resources definitions for a given orchestrator.
 * @param location the location.
 * @return A list of resource definitions for the given location.
 */
public LocationResources getLocationResources(Location location){
  List<LocationResourceTemplate> locationResourceTemplates=getResourcesTemplates(location.getId());
  if (locationResourceTemplates == null || locationResourceTemplates.size() == 0) {
    return getLocationResourcesFromOrchestrator(location);
  }
  LocationResources locationResources=new LocationResources(getLocationResourceTypes(locationResourceTemplates));
  setLocationRessource(locationResourceTemplates,locationResources);
  return locationResources;
}

Fixed version (ground truth):
/** 
 * Get the list of resources definitions for a given orchestrator.
 * @param location the location.
 * @return A list of resource definitions for the given location.
 */
public LocationResources getLocationResources(Location location){
  Orchestrator orchestrator=orchestratorService.get(location.getOrchestratorId());
  if (orchestrator != null && orchestratorPluginService.get(orchestrator.getId()) != null) {
    return getLocationResourcesFromOrchestrator(location);
  }
  List<LocationResourceTemplate> locationResourceTemplates=getResourcesTemplates(location.getId());
  LocationResources locationResources=new LocationResources(getLocationResourceTypes(locationResourceTemplates));
  setLocationRessource(locationResourceTemplates,locationResources);
  return locationResources;
}
Program: 62398
Project: 62398
Buggy source:
/** 
 * Update node substitution.
 * @param appId id of the application.
 * @param environmentId id of the environment.
 * @return response containing the available substitutions.
 */
@ApiOperation(value="String_Node_Str",notes="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @PreAuthorize("String_Node_Str") @Audit public RestResponse<DeploymentTopologyDTO> updateSubstitution(@PathVariable String appId,@PathVariable String environmentId,@PathVariable String nodeId,@RequestParam String locationResourceTemplateId){
  checkAuthorizations(appId,environmentId);
  DeploymentConfiguration deploymentConfiguration=deploymentTopologyService.getDeploymentConfiguration(environmentId);
  DeploymentTopology deploymentTopology=deploymentConfiguration.getDeploymentTopology();
  locationResourceService.getOrFail(locationResourceTemplateId);
  deploymentTopology.getSubstitutedNodes().put(nodeId,locationResourceTemplateId);
  deploymentTopologyService.updateDeploymentTopology(deploymentTopology);
  return RestResponseBuilder.<DeploymentTopologyDTO>builder().data(buildDeploymentTopologyDTO(deploymentConfiguration)).build();
}

Fixed version (ground truth):
/** 
 * Update node substitution.
 * @param appId id of the application.
 * @param environmentId id of the environment.
 * @return response containing the available substitutions.
 */
@ApiOperation(value="String_Node_Str",notes="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @PreAuthorize("String_Node_Str") @Audit public RestResponse<DeploymentTopologyDTO> updateSubstitution(@PathVariable String appId,@PathVariable String environmentId,@PathVariable String nodeId,@RequestParam String locationResourceTemplateId){
  checkAuthorizations(appId,environmentId);
  DeploymentConfiguration deploymentConfiguration=deploymentTopologyService.updateSubstitution(environmentId,nodeId,locationResourceTemplateId);
  return RestResponseBuilder.<DeploymentTopologyDTO>builder().data(buildDeploymentTopologyDTO(deploymentConfiguration)).build();
}
Program: 62400
Project: 62400
Buggy source:
/** 
 * Get or create if not yet existing the   {@link DeploymentTopology}
 * @param environmentId environment's id
 * @return the existing deployment topology or new created one
 */
private DeploymentTopology getOrCreateDeploymentTopology(String environmentId){
  ApplicationEnvironment environment=appEnvironmentServices.getOrFail(environmentId);
  ApplicationVersion version=applicationVersionService.getOrFail(environment.getCurrentVersionId());
  return getOrCreateDeploymentTopology(environment,version.getTopologyId());
}

Fixed version (ground truth):
/** 
 * Get or create if not yet existing the   {@link DeploymentTopology}. This method will check if the initial topology has been updated, if so it will try to re-synchronize the topology and the deployment topology
 * @param environment the environment
 * @return the related or created deployment topology
 */
private DeploymentTopology getOrCreateDeploymentTopology(ApplicationEnvironment environment,String topologyId){
  String id=DeploymentTopology.generateId(environment.getCurrentVersionId(),environment.getId());
  DeploymentTopology deploymentTopology=alienDAO.findById(DeploymentTopology.class,id);
  Topology topology=topologyServiceCore.getOrFail(topologyId);
  if (deploymentTopology == null) {
    deploymentTopology=generateDeploymentTopology(id,environment,topology,new DeploymentTopology());
  }
 else {
    Map<String,String> locationIds=TopologyLocationUtils.getLocationIds(deploymentTopology);
    boolean locationsInvalid=false;
    Map<String,Location> locations=Maps.newHashMap();
    if (!MapUtils.isEmpty(locationIds)) {
      try {
        locations=getLocations(locationIds);
      }
 catch (      NotFoundException ignored) {
        locationsInvalid=true;
      }
    }
    if (locationsInvalid) {
      deploymentTopology=generateDeploymentTopology(id,environment,topology,new DeploymentTopology());
    }
 else     if (checkIfTopologyOrLocationHasChanged(deploymentTopology,locations.values(),topology)) {
      generateDeploymentTopology(id,environment,topology,deploymentTopology);
    }
  }
  return deploymentTopology;
}
Program: 62401
Project: 62401
Buggy source:
@Override public void setConstraintValue(IPropertyType<?> toscaType,String textValue) throws ConstraintValueDoNotMatchPropertyTypeException {
  typed=ConstraintUtil.convert(toscaType,textValue);
}

Fixed version (ground truth):
@Override public void setConstraintValue(IPropertyType<?> toscaType,String textValue) throws ConstraintValueDoNotMatchPropertyTypeException {
  equal=textValue;
  typed=ConstraintUtil.convert(toscaType,textValue);
}
Program: 62402
Project: 62402
Buggy source:
public void setTemplateProperty(LocationResourceTemplate resourceTemplate,String propertyName,Object propertyValue){
  Location location=locationService.getOrFail(resourceTemplate.getLocationId());
  IndexedNodeType resourceType=csarRepoSearchService.getRequiredElementInDependencies(IndexedNodeType.class,resourceTemplate.getTemplate().getType(),location.getDependencies());
  if (resourceType.getProperties() == null || !resourceType.getProperties().containsKey(propertyName)) {
    throw new NotFoundException("String_Node_Str" + propertyName + "String_Node_Str"+ resourceType.getElementId()+ "String_Node_Str");
  }
  PropertyUtil.setPropertyValue(resourceTemplate.getTemplate(),resourceType.getProperties().get(propertyName),propertyName,propertyValue);
}

Fixed version (ground truth):
public void setTemplateProperty(String resourceId,String propertyName,Object propertyValue) throws ConstraintValueDoNotMatchPropertyTypeException, ConstraintViolationException {
  LocationResourceTemplate resourceTemplate=getOrFail(resourceId);
  Location location=locationService.getOrFail(resourceTemplate.getLocationId());
  IndexedNodeType resourceType=csarRepoSearchService.getRequiredElementInDependencies(IndexedNodeType.class,resourceTemplate.getTemplate().getType(),location.getDependencies());
  if (resourceType.getProperties() == null || !resourceType.getProperties().containsKey(propertyName)) {
    throw new NotFoundException("String_Node_Str" + propertyName + "String_Node_Str"+ resourceType.getElementId()+ "String_Node_Str");
  }
  propertyService.setPropertyValue(resourceTemplate.getTemplate(),resourceType.getProperties().get(propertyName),propertyName,propertyValue);
  saveResource(resourceTemplate);
}
Program: 62403
Project: 62403
Buggy source:
/** 
 * Load plugins from the initialiaztion plugins folder.
 */
public void loadPlugins(){
  if (alienInitDirectory == null || alienInitDirectory.isEmpty()) {
    log.debug("String_Node_Str");
    return;
  }
  if (!Files.exists(alienPluginsInitPath) || !Files.isDirectory(alienPluginsInitPath)) {
    log.warn("String_Node_Str",alienPluginsInitPath.toString());
    return;
  }
  try {
    List<Path> plugins=FileUtil.listFiles(alienPluginsInitPath,"String_Node_Str");
    for (    Path plugin : plugins) {
      try {
        pluginManager.uploadPlugin(plugin);
      }
 catch (      AlreadyExistException e) {
        log.debug("String_Node_Str",plugin.toString());
      }
catch (      PluginLoadingException|MissingPlugingDescriptorFileException e) {
        log.error("String_Node_Str",plugin.toString(),e);
      }
    }
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Load plugins from the initialiaztion plugins folder.
 */
public void loadPlugins(){
  if (alienInitDirectory == null || alienInitDirectory.isEmpty() || alienPluginsInitPath == null) {
    log.debug("String_Node_Str");
    return;
  }
  if (!Files.exists(alienPluginsInitPath) || !Files.isDirectory(alienPluginsInitPath)) {
    log.warn("String_Node_Str",alienPluginsInitPath.toString());
    return;
  }
  try {
    List<Path> plugins=FileUtil.listFiles(alienPluginsInitPath,"String_Node_Str");
    for (    Path plugin : plugins) {
      try {
        pluginManager.uploadPlugin(plugin);
      }
 catch (      AlreadyExistException e) {
        log.debug("String_Node_Str",plugin.toString());
      }
catch (      PluginLoadingException|MissingPlugingDescriptorFileException e) {
        log.error("String_Node_Str",plugin.toString(),e);
      }
    }
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
}