nus-yam/ex-repair huggingface dataset:
Program: 60492
Project: 60492
Buggy source:
@Override public void execute(final Input input){
  if (StringUtils.isBlank(input.getOption())) {
    input.setOption(Options.HELP.getOptionName());
  }
switch (Options.fromName(input.getOption())) {
case INSTALL:
    try {
      new InstallSetup().setup();
    }
 catch (    final FileNotFoundException|IllegalAccessException ex) {
      LOG.error("String_Node_Str",ex);
      installResultManager.genericError(ex.getMessage());
      break;
    }
  break;
case HELP:
System.out.println(HELP_MESSAGE);
break;
default :
installResultManager.defaultOptionMessage(input.getOption(),HELP_MESSAGE);
}
}

Fixed version (ground truth):
@Override public void execute(final Input input){
  if (StringUtils.isBlank(input.getOption())) {
    input.setOption(Options.HELP.getOptionName());
  }
switch (Options.fromName(input.getOption())) {
case SETUP:
    try {
      new InstallSetup().setup();
    }
 catch (    final FileNotFoundException|IllegalAccessException ex) {
      LOG.error("String_Node_Str",ex);
      installResultManager.genericError(ex.getMessage());
      break;
    }
  break;
case SETUP_DEBUG:
try {
  new InstallSetupForDebug().setup();
}
 catch (final FileNotFoundException|IllegalAccessException ex) {
  LOG.error("String_Node_Str",ex);
  installResultManager.genericError(ex.getMessage());
  break;
}
break;
case HELP:
System.out.println(HELP_MESSAGE);
break;
default :
installResultManager.defaultOptionMessage(input.getOption(),HELP_MESSAGE);
}
}
Program: 60493
Project: 60493
Buggy source:
@Override public void execute(final Input input){
  if (StringUtils.isBlank(input.getOption())) {
    input.setOption(UserOptions.HELP.getOptionName());
  }
switch (UserOptions.fromName(input.getOption())) {
case DETAILS:
    new UserDetails(input).details();
  break;
case LIST:
new UserList(input).list();
break;
case GET_BY_KEY:
new UserGetKey(input).get();
break;
case GET_BY_USERNAME:
new UserGetUsername(input).get();
break;
case READ:
new UserRead(input).read();
break;
case SEARCH_BY_ATTRIBUTE:
new UserSearchByAttribute(input).search();
break;
case SEARCH_BY_ROLE:
new UserSearchByRole(input).search();
break;
case SEARCH_BY_RESOURCE:
new UserSearchByResource(input).search();
break;
case DELETE:
new UserDelete(input).delete();
break;
case HELP:
System.out.println(getHelpMessage());
break;
default :
userResultManager.defaultOptionMessage(input.getOption(),getHelpMessage());
}
}

Fixed version (ground truth):
@Override public void execute(final Input input){
  if (StringUtils.isBlank(input.getOption())) {
    input.setOption(UserOptions.HELP.getOptionName());
  }
switch (UserOptions.fromName(input.getOption())) {
case DETAILS:
    new UserDetails(input).details();
  break;
case LIST:
new UserList(input).list();
break;
case GET_BY_KEY:
new UserGetKey(input).get();
break;
case GET_BY_USERNAME:
new UserGetUsername(input).get();
break;
case READ:
new UserRead(input).read();
break;
case SEARCH_BY_ATTRIBUTE:
new UserSearchByAttribute(input).search();
break;
case SEARCH_BY_ROLE:
new UserSearchByRole(input).search();
break;
case SEARCH_BY_RESOURCE:
new UserSearchByResource(input).search();
break;
case DELETE:
new UserDelete(input).delete();
break;
case DELETE_ALL:
new UserDeleteAll(input).delete();
break;
case DELETE_BY_ATTRIBUTE:
new UserDeleteByAttribute(input).delete();
break;
case HELP:
System.out.println(getHelpMessage());
break;
default :
userResultManager.defaultOptionMessage(input.getOption(),getHelpMessage());
}
}
Program: 60494
Project: 60494
Buggy source:
@Override public void execute(final Input input){
  if (StringUtils.isBlank(input.getOption())) {
    input.setOption(Options.HELP.getOptionName());
  }
switch (Options.fromName(input.getOption())) {
case DETAILS:
    new PolicyDetails(input).details();
  break;
case LIST_POLICY:
new PolicyList(input).list();
break;
case READ:
new PolicyRead(input).read();
break;
case DELETE:
new PolicyDelete(input).delete();
break;
case HELP:
System.out.println(HELP_MESSAGE);
break;
default :
new PolicyResultManager().defaultOptionMessage(input.getOption(),HELP_MESSAGE);
}
}

Fixed version (ground truth):
@Override public void execute(final Input input){
  if (StringUtils.isBlank(input.getOption())) {
    input.setOption(Options.HELP.getOptionName());
  }
switch (Options.fromName(input.getOption())) {
case DETAILS:
    new PolicyDetails(input).details();
  break;
case LIST:
new PolicyList(input).list();
break;
case READ:
new PolicyRead(input).read();
break;
case DELETE:
new PolicyDelete(input).delete();
break;
case HELP:
System.out.println(HELP_MESSAGE);
break;
default :
new PolicyResultManager().defaultOptionMessage(input.getOption(),HELP_MESSAGE);
}
}
Program: 60495
Project: 60495
Buggy source:
public void details(){
  if (input.parameterNumber() == 0) {
    try {
      final Map<String,String> details=new LinkedMap<>();
      final int accountPolicySize=policySyncopeOperations.list(PolicyType.ACCOUNT).size();
      final int passwordPolicySize=policySyncopeOperations.list(PolicyType.PASSWORD).size();
      final int syncPolicySize=policySyncopeOperations.list(PolicyType.SYNC).size();
      final int pushPolicySize=policySyncopeOperations.list(PolicyType.PUSH).size();
      details.put("String_Node_Str",String.valueOf(accountPolicySize + passwordPolicySize + syncPolicySize+ pushPolicySize));
      details.put("String_Node_Str",String.valueOf(accountPolicySize));
      details.put("String_Node_Str",String.valueOf(passwordPolicySize));
      details.put("String_Node_Str",String.valueOf(syncPolicySize));
      details.put("String_Node_Str",String.valueOf(pushPolicySize));
      policyResultManager.printDetails(details);
    }
 catch (    final Exception ex) {
      LOG.error("String_Node_Str",ex);
      policyResultManager.genericError(ex.getMessage());
    }
  }
 else {
    policyResultManager.commandOptionError(DETAILS_HELP_MESSAGE);
  }
}

Fixed version (ground truth):
public void details(){
  if (input.parameterNumber() == 0) {
    try {
      final Map<String,String> details=new LinkedMap<>();
      final int accountPolicySize=policySyncopeOperations.list(PolicyType.ACCOUNT.name()).size();
      final int passwordPolicySize=policySyncopeOperations.list(PolicyType.PASSWORD.name()).size();
      final int syncPolicySize=policySyncopeOperations.list(PolicyType.SYNC.name()).size();
      final int pushPolicySize=policySyncopeOperations.list(PolicyType.PUSH.name()).size();
      details.put("String_Node_Str",String.valueOf(accountPolicySize + passwordPolicySize + syncPolicySize+ pushPolicySize));
      details.put("String_Node_Str",String.valueOf(accountPolicySize));
      details.put("String_Node_Str",String.valueOf(passwordPolicySize));
      details.put("String_Node_Str",String.valueOf(syncPolicySize));
      details.put("String_Node_Str",String.valueOf(pushPolicySize));
      policyResultManager.printDetails(details);
    }
 catch (    final Exception ex) {
      LOG.error("String_Node_Str",ex);
      policyResultManager.genericError(ex.getMessage());
    }
  }
 else {
    policyResultManager.commandOptionError(DETAILS_HELP_MESSAGE);
  }
}
Program: 60496
Project: 60496
Buggy source:
public void list(){
  if (input.parameterNumber() == 1) {
    try {
      final PolicyType policyType=PolicyType.valueOf(input.firstParameter());
      final LinkedList<AbstractPolicyTO> policyTOs=new LinkedList<>();
      for (      final AbstractPolicyTO policyTO : policySyncopeOperations.list(policyType)) {
        policyTOs.add(policyTO);
      }
      policyResultManager.printPoliciesByType(policyType,policyTOs);
    }
 catch (    final SyncopeClientException ex) {
      LOG.error("String_Node_Str",ex);
      policyResultManager.genericError(ex.getMessage());
    }
catch (    final IllegalArgumentException ex) {
      LOG.error("String_Node_Str",ex);
      policyResultManager.typeNotValidError("String_Node_Str",input.firstParameter(),CommandUtils.fromEnumToArray(PolicyType.class));
    }
  }
 else {
    policyResultManager.commandOptionError(LIST_HELP_MESSAGE);
  }
}

Fixed version (ground truth):
public void list(){
  if (input.parameterNumber() == 1) {
    try {
      final LinkedList<AbstractPolicyTO> policyTOs=new LinkedList<>();
      for (      final AbstractPolicyTO policyTO : policySyncopeOperations.list(input.firstParameter())) {
        policyTOs.add(policyTO);
      }
      policyResultManager.printPoliciesByType(input.firstParameter(),policyTOs);
    }
 catch (    final SyncopeClientException ex) {
      LOG.error("String_Node_Str",ex);
      policyResultManager.genericError(ex.getMessage());
    }
catch (    final IllegalArgumentException ex) {
      LOG.error("String_Node_Str",ex);
      policyResultManager.typeNotValidError("String_Node_Str",input.firstParameter(),CommandUtils.fromEnumToArray(PolicyType.class));
    }
  }
 else {
    policyResultManager.commandOptionError(LIST_HELP_MESSAGE);
  }
}
Program: 60497
Project: 60497
Buggy source:
public void printPoliciesByType(final PolicyType policyType,final LinkedList<AbstractPolicyTO> policyTOs){
  System.out.println("String_Node_Str");
switch (policyType) {
case ACCOUNT:
    for (    final AbstractPolicyTO policyTO : policyTOs) {
      printAccountPolicy((AccountPolicyTO)policyTO);
    }
  break;
case PASSWORD:
for (final AbstractPolicyTO policyTO : policyTOs) {
  printPasswordPolicy((PasswordPolicyTO)policyTO);
}
break;
case PUSH:
for (final AbstractPolicyTO policyTO : policyTOs) {
System.out.println(policyTO);
}
break;
case SYNC:
for (final AbstractPolicyTO policyTO : policyTOs) {
printSyncPolicy((SyncPolicyTO)policyTO);
}
break;
default :
break;
}
}

Fixed version (ground truth):
public void printPoliciesByType(final String policyTypeString,final LinkedList<AbstractPolicyTO> policyTOs){
  System.out.println("String_Node_Str");
  final PolicyType policyType=PolicyType.valueOf(policyTypeString);
switch (policyType) {
case ACCOUNT:
    for (    final AbstractPolicyTO policyTO : policyTOs) {
      printAccountPolicy((AccountPolicyTO)policyTO);
    }
  break;
case PASSWORD:
for (final AbstractPolicyTO policyTO : policyTOs) {
  printPasswordPolicy((PasswordPolicyTO)policyTO);
}
break;
case PUSH:
for (final AbstractPolicyTO policyTO : policyTOs) {
System.out.println(policyTO);
}
break;
case SYNC:
for (final AbstractPolicyTO policyTO : policyTOs) {
printSyncPolicy((SyncPolicyTO)policyTO);
}
break;
default :
break;
}
}
Program: 60498
Project: 60498
Buggy source:
public <T extends AbstractPolicyTO>List<T> list(final PolicyType policyType){
  return policyService.list(policyType);
}

Fixed version (ground truth):
public <T extends AbstractPolicyTO>List<T> list(final String policyType){
  return policyService.list(PolicyType.valueOf(policyType));
}
Program: 60500
Project: 60500
Buggy source:
public void list(){
  if (input.parameterNumber() == 0) {
    try {
      for (      final JobStatusType jobStatusType : JobStatusType.values()) {
        reportResultManager.printReportExecution(reportSyncopeOperations.listJobs(jobStatusType));
      }
    }
 catch (    final SyncopeClientException ex) {
      LOG.error("String_Node_Str",ex);
      reportResultManager.genericError(ex.getMessage());
    }
  }
 else {
    reportResultManager.unnecessaryParameters(input.listParameters(),LIST_HELP_MESSAGE);
  }
}

Fixed version (ground truth):
public void list(){
  if (input.parameterNumber() == 0) {
    try {
      for (      final JobStatusType jobStatusType : JobStatusType.values()) {
        reportResultManager.printReportExecution(reportSyncopeOperations.listJobs(jobStatusType.name()));
      }
    }
 catch (    final SyncopeClientException ex) {
      LOG.error("String_Node_Str",ex);
      reportResultManager.genericError(ex.getMessage());
    }
  }
 else {
    reportResultManager.unnecessaryParameters(input.listParameters(),LIST_HELP_MESSAGE);
  }
}
Program: 60501
Project: 60501
Buggy source:
public List<ReportExecTO> listJobs(final JobStatusType jobStatusType){
  return reportService.listJobs(jobStatusType);
}

Fixed version (ground truth):
public List<ReportExecTO> listJobs(final String jobStatusType){
  return reportService.listJobs(JobStatusType.valueOf(jobStatusType));
}
Program: 60502
Project: 60502
Buggy source:
public Response exportExecutionResult(final String executionKey,final ReportExecExportFormat fmt){
  return reportService.exportExecutionResult(Long.valueOf(executionKey),fmt);
}

Fixed version (ground truth):
public String exportExecutionResult(final String executionKey,final String reportExecExportFormat) throws TransformerException, SAXException, IOException, ParserConfigurationException {
  final ReportExecExportFormat format=ReportExecExportFormat.valueOf(reportExecExportFormat);
  final SequenceInputStream report=(SequenceInputStream)reportService.exportExecutionResult(Long.valueOf(executionKey),format).getEntity();
  final String xmlFinalName="String_Node_Str" + executionKey + "String_Node_Str";
switch (format) {
case XML:
    XMLUtils.createXMLFile(report,xmlFinalName);
  break;
case CSV:
return format + "String_Node_Str";
case PDF:
return format + "String_Node_Str";
case HTML:
return format + "String_Node_Str";
case RTF:
return format + "String_Node_Str";
default :
return format + "String_Node_Str";
}
return xmlFinalName;
}
Program: 60503
Project: 60503
Buggy source:
public void delete(){
  if (input.parameterNumber() >= 2) {
    final String[] parameters=Arrays.copyOfRange(input.getParameters(),1,input.parameterNumber());
    try {
      for (      final String parameter : parameters) {
        schemaSyncopeOperations.delete(SchemaType.valueOf(input.firstParameter()),parameter);
        schemaResultManager.deletedMessage("String_Node_Str",parameter);
      }
    }
 catch (    final SyncopeClientException|WebServiceException ex) {
      LOG.error("String_Node_Str",ex);
      if (ex.getMessage().startsWith("String_Node_Str")) {
        schemaResultManager.notFoundError("String_Node_Str",parameters[0]);
      }
 else       if (ex.getMessage().startsWith("String_Node_Str")) {
        schemaResultManager.genericError("String_Node_Str" + parameters[0]);
      }
 else {
        schemaResultManager.genericError(ex.getMessage());
      }
    }
catch (    final IllegalArgumentException ex) {
      LOG.error("String_Node_Str",ex);
      schemaResultManager.typeNotValidError("String_Node_Str",input.firstParameter(),CommandUtils.fromEnumToArray(SchemaType.class));
    }
  }
 else {
    schemaResultManager.commandOptionError(DELETE_HELP_MESSAGE);
  }
}

Fixed version (ground truth):
public void delete(){
  if (input.parameterNumber() >= 2) {
    final String[] parameters=Arrays.copyOfRange(input.getParameters(),1,input.parameterNumber());
    try {
      for (      final String parameter : parameters) {
        schemaSyncopeOperations.delete(input.firstParameter(),parameter);
        schemaResultManager.deletedMessage("String_Node_Str",parameter);
      }
    }
 catch (    final SyncopeClientException|WebServiceException ex) {
      LOG.error("String_Node_Str",ex);
      if (ex.getMessage().startsWith("String_Node_Str")) {
        schemaResultManager.notFoundError("String_Node_Str",parameters[0]);
      }
 else       if (ex.getMessage().startsWith("String_Node_Str")) {
        schemaResultManager.genericError("String_Node_Str" + parameters[0]);
      }
 else {
        schemaResultManager.genericError(ex.getMessage());
      }
    }
catch (    final IllegalArgumentException ex) {
      LOG.error("String_Node_Str",ex);
      schemaResultManager.typeNotValidError("String_Node_Str",input.firstParameter(),CommandUtils.fromEnumToArray(SchemaType.class));
    }
  }
 else {
    schemaResultManager.commandOptionError(DELETE_HELP_MESSAGE);
  }
}
Program: 60504
Project: 60504
Buggy source:
public void list(){
  if (input.parameterNumber() == 1) {
    try {
      final SchemaType schemaType=SchemaType.valueOf(input.firstParameter());
      final LinkedList<AbstractSchemaTO> schemaTOs=new LinkedList<>();
      for (      final AbstractSchemaTO schemaTO : schemaSyncopeOperations.list(schemaType)) {
        schemaTOs.add(schemaTO);
      }
switch (schemaType) {
case PLAIN:
        schemaResultManager.printSchemas(schemaTOs);
      break;
case DERIVED:
    schemaResultManager.fromListDerived(schemaTOs);
  break;
case VIRTUAL:
schemaResultManager.fromListVirtual(schemaTOs);
break;
default :
break;
}
}
 catch (final SyncopeClientException ex) {
LOG.error("String_Node_Str",ex);
schemaResultManager.genericError(ex.getMessage());
}
catch (final IllegalArgumentException ex) {
LOG.error("String_Node_Str",ex);
schemaResultManager.typeNotValidError("String_Node_Str",input.firstParameter(),CommandUtils.fromEnumToArray(SchemaType.class));
}
}
 else {
schemaResultManager.commandOptionError(LIST_HELP_MESSAGE);
}
}

Fixed version (ground truth):
public void list(){
  if (input.parameterNumber() == 1) {
    try {
      final LinkedList<AbstractSchemaTO> schemaTOs=new LinkedList<>();
      for (      final AbstractSchemaTO schemaTO : schemaSyncopeOperations.list(input.firstParameter())) {
        schemaTOs.add(schemaTO);
      }
      schemaResultManager.toView(input.firstParameter(),schemaTOs);
    }
 catch (    final SyncopeClientException ex) {
      LOG.error("String_Node_Str",ex);
      schemaResultManager.genericError(ex.getMessage());
    }
catch (    final IllegalArgumentException ex) {
      LOG.error("String_Node_Str",ex);
      schemaResultManager.typeNotValidError("String_Node_Str",input.firstParameter(),CommandUtils.fromEnumToArray(SchemaType.class));
    }
  }
 else {
    schemaResultManager.commandOptionError(LIST_HELP_MESSAGE);
  }
}
Program: 60505
Project: 60505
Buggy source:
public void listAll(){
  if (input.parameterNumber() == 0) {
    try {
      for (      final SchemaType schemaType : SchemaType.values()) {
        final LinkedList<AbstractSchemaTO> schemaTOs=new LinkedList<>();
        for (        final AbstractSchemaTO schemaTO : schemaSyncopeOperations.list(schemaType)) {
          schemaTOs.add(schemaTO);
        }
switch (schemaType) {
case PLAIN:
          schemaResultManager.printSchemas(schemaTOs);
        break;
case DERIVED:
      schemaResultManager.fromListDerived(schemaTOs);
    break;
case VIRTUAL:
  schemaResultManager.fromListVirtual(schemaTOs);
break;
default :
break;
}
}
}
 catch (final SyncopeClientException|WebServiceException ex) {
LOG.error("String_Node_Str",ex);
schemaResultManager.genericError(ex.getMessage());
}
}
 else {
schemaResultManager.unnecessaryParameters(input.listParameters(),LIST_HELP_MESSAGE);
}
}

Fixed version (ground truth):
public void listAll(){
  if (input.parameterNumber() == 0) {
    try {
      for (      final SchemaType schemaType : SchemaType.values()) {
        final LinkedList<AbstractSchemaTO> schemaTOs=new LinkedList<>();
        for (        final AbstractSchemaTO schemaTO : schemaSyncopeOperations.list(schemaType.name())) {
          schemaTOs.add(schemaTO);
        }
        schemaResultManager.toView(schemaType.name(),schemaTOs);
      }
    }
 catch (    final SyncopeClientException|WebServiceException ex) {
      LOG.error("String_Node_Str",ex);
      schemaResultManager.genericError(ex.getMessage());
    }
  }
 else {
    schemaResultManager.unnecessaryParameters(input.listParameters(),LIST_HELP_MESSAGE);
  }
}
Program: 60506
Project: 60506
Buggy source:
public void listPlain(){
  if (input.parameterNumber() == 0) {
    try {
      final LinkedList<AbstractSchemaTO> schemaTOs=new LinkedList<>();
      for (      final AbstractSchemaTO schemaTO : schemaSyncopeOperations.listPlain()) {
        schemaTOs.add(schemaTO);
      }
      schemaResultManager.printSchemas(schemaTOs);
    }
 catch (    final SyncopeClientException|WebServiceException ex) {
      LOG.error("String_Node_Str",ex);
      schemaResultManager.genericError(ex.getMessage());
    }
  }
 else {
    schemaResultManager.unnecessaryParameters(input.listParameters(),LIST_HELP_MESSAGE);
  }
}

Fixed version (ground truth):
public void listPlain(){
  if (input.parameterNumber() == 0) {
    try {
      final LinkedList<AbstractSchemaTO> schemaTOs=new LinkedList<>();
      for (      final AbstractSchemaTO schemaTO : schemaSyncopeOperations.listPlain()) {
        schemaTOs.add(schemaTO);
      }
      schemaResultManager.printPlainSchemas(schemaTOs);
    }
 catch (    final SyncopeClientException|WebServiceException ex) {
      LOG.error("String_Node_Str",ex);
      schemaResultManager.genericError(ex.getMessage());
    }
  }
 else {
    schemaResultManager.unnecessaryParameters(input.listParameters(),LIST_HELP_MESSAGE);
  }
}
Program: 60507
Project: 60507
Buggy source:
public void read(){
  if (input.parameterNumber() >= 2) {
    final String[] parameters=Arrays.copyOfRange(input.getParameters(),1,input.parameterNumber());
    try {
      final SchemaType schemaType=SchemaType.valueOf(input.firstParameter());
      final LinkedList<AbstractSchemaTO> schemaTOs=new LinkedList<>();
      for (      final String parameter : parameters) {
        schemaTOs.add(schemaSyncopeOperations.read(schemaType,parameter));
      }
switch (schemaType) {
case PLAIN:
        schemaResultManager.printSchemasWithDetails(schemaTOs);
      break;
case DERIVED:
    schemaResultManager.fromListDerived(schemaTOs);
  break;
case VIRTUAL:
schemaResultManager.fromListVirtual(schemaTOs);
break;
default :
break;
}
}
 catch (final SyncopeClientException|WebServiceException ex) {
LOG.error("String_Node_Str",ex);
if (ex.getMessage().startsWith("String_Node_Str")) {
schemaResultManager.notFoundError("String_Node_Str",parameters[0]);
}
 else {
schemaResultManager.genericError(ex.getMessage());
}
}
catch (final IllegalArgumentException ex) {
LOG.error("String_Node_Str",ex);
schemaResultManager.typeNotValidError("String_Node_Str",input.firstParameter(),CommandUtils.fromEnumToArray(SchemaType.class));
}
}
 else {
schemaResultManager.commandOptionError(READ_HELP_MESSAGE);
}
}

Fixed version (ground truth):
public void read(){
  if (input.parameterNumber() >= 2) {
    final String[] parameters=Arrays.copyOfRange(input.getParameters(),1,input.parameterNumber());
    try {
      final LinkedList<AbstractSchemaTO> schemaTOs=new LinkedList<>();
      for (      final String parameter : parameters) {
        schemaTOs.add(schemaSyncopeOperations.read(input.firstParameter(),parameter));
      }
      schemaResultManager.toView(input.firstParameter(),schemaTOs);
    }
 catch (    final SyncopeClientException|WebServiceException ex) {
      LOG.error("String_Node_Str",ex);
      if (ex.getMessage().startsWith("String_Node_Str")) {
        schemaResultManager.notFoundError("String_Node_Str",parameters[0]);
      }
 else {
        schemaResultManager.genericError(ex.getMessage());
      }
    }
catch (    final IllegalArgumentException ex) {
      LOG.error("String_Node_Str",ex);
      schemaResultManager.typeNotValidError("String_Node_Str",input.firstParameter(),CommandUtils.fromEnumToArray(SchemaType.class));
    }
  }
 else {
    schemaResultManager.commandOptionError(READ_HELP_MESSAGE);
  }
}
Program: 60508
Project: 60508
Buggy source:
public void details(){
  if (input.parameterNumber() == 0) {
    try {
      final Map<String,String> details=new LinkedMap<>();
      final List<UserTO> usersTOs=userSyncopeOperations.list().getResult();
      int withoutResource=0;
      int withoutRole=0;
      int activeStatus=0;
      int suspendedStatus=0;
      for (      final UserTO userTO : usersTOs) {
        if (!userTO.getResources().isEmpty()) {
          withoutResource++;
        }
        if (!userTO.getRoles().isEmpty()) {
          withoutRole++;
        }
        if ("String_Node_Str".equalsIgnoreCase(userTO.getStatus())) {
          activeStatus++;
        }
 else         if ("String_Node_Str".equalsIgnoreCase(userTO.getStatus())) {
          suspendedStatus++;
        }
      }
      details.put("String_Node_Str",String.valueOf(usersTOs.size()));
      details.put("String_Node_Str",String.valueOf(activeStatus));
      details.put("String_Node_Str",String.valueOf(suspendedStatus));
      details.put("String_Node_Str",String.valueOf(withoutResource));
      details.put("String_Node_Str",String.valueOf(withoutRole));
      userResultManager.printDetails(details);
    }
 catch (    final SyncopeClientException ex) {
      LOG.error("String_Node_Str",ex);
      userResultManager.genericError(ex.getMessage());
    }
  }
 else {
    userResultManager.unnecessaryParameters(input.listParameters(),COUNT_HELP_MESSAGE);
  }
}

Fixed version (ground truth):
public void details(){
  if (input.parameterNumber() == 0) {
    try {
      final Map<String,String> details=new LinkedMap<>();
      final List<UserTO> usersTOs=userSyncopeOperations.list().getResult();
      int withoutResource=0;
      int withoutRole=0;
      int activeStatus=0;
      int suspendedStatus=0;
      for (      final UserTO userTO : usersTOs) {
        if (userTO.getResources().isEmpty()) {
          withoutResource++;
        }
        if (userTO.getRoles().isEmpty()) {
          withoutRole++;
        }
        if ("String_Node_Str".equalsIgnoreCase(userTO.getStatus())) {
          activeStatus++;
        }
 else         if ("String_Node_Str".equalsIgnoreCase(userTO.getStatus())) {
          suspendedStatus++;
        }
      }
      details.put("String_Node_Str",String.valueOf(usersTOs.size()));
      details.put("String_Node_Str",String.valueOf(activeStatus));
      details.put("String_Node_Str",String.valueOf(suspendedStatus));
      details.put("String_Node_Str",String.valueOf(withoutResource));
      details.put("String_Node_Str",String.valueOf(withoutRole));
      userResultManager.printDetails(details);
    }
 catch (    final SyncopeClientException ex) {
      LOG.error("String_Node_Str",ex);
      userResultManager.genericError(ex.getMessage());
    }
  }
 else {
    userResultManager.unnecessaryParameters(input.listParameters(),COUNT_HELP_MESSAGE);
  }
}
Program: 60510
Project: 60510
Buggy source:
public T getModelObject(){
  return (T)field.getModelObject();
}

Fixed version (ground truth):
public T getModelObject(){
  return field.getModelObject();
}
Program: 60511
Project: 60511
Buggy source:
public void typeNotValidError(final String parameter){
  Messages.printTypeNotValidMessage("String_Node_Str",parameter,CommandUtils.fromEnumToArray(LoggerLevel.class));
}

Fixed version (ground truth):
public void typeNotValidError(final String what,final String parameter,final String[] options){
  Messages.printTypeNotValidMessage(what,parameter,options);
}
Program: 60512
Project: 60512
Buggy source:
public static void validator(final String[] args) throws IllegalArgumentException {
  if (args.length == 0) {
    throw new IllegalArgumentException();
  }
 else   if (!"String_Node_Str".equalsIgnoreCase(args[0])) {
    final File configFile=new File(InstallConfigFileTemplate.FILE_PATH);
    if (!configFile.exists()) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public static void validator(final String[] args) throws IllegalArgumentException {
  if (args.length == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (!"String_Node_Str".equalsIgnoreCase(args[0])) {
    final File configFile=new File(InstallConfigFileTemplate.FILE_PATH);
    if (!configFile.exists()) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
}
Program: 60513
Project: 60513
Buggy source:
public Input(final String[] args) throws InstantiationException, IllegalAccessException, IllegalArgumentException {
  command=fromArgs(args[0]);
  if (args.length > 1) {
    option=args[1];
  }
  if (args.length > 2) {
    parameters=new String[args.length - 2];
    for (int i=0; i < parameters.length; i++) {
      parameters[i]=args[i + 2];
    }
  }
 else {
    parameters=new String[0];
  }
}

Fixed version (ground truth):
public Input(final String[] args) throws InstantiationException, IllegalAccessException, IllegalArgumentException {
  command=CommandUtils.fromArgs(args[0]);
  if (args.length > 1) {
    option=args[1];
  }
  if (args.length > 2) {
    parameters=new String[args.length - 2];
    for (int i=0; i < parameters.length; i++) {
      parameters[i]=args[i + 2];
    }
  }
 else {
    parameters=new String[0];
  }
}
Program: 60514
Project: 60514
Buggy source:
public static void main(final String[] args){
  LOG.debug("String_Node_Str");
  try {
    ArgsManager.validator(args);
    final Input input=new Input(args);
    final AbstractCommand command=input.getCommand();
    command.execute(input);
  }
 catch (  final IllegalAccessException|InstantiationException e) {
    LOG.error("String_Node_Str",e);
    e.printStackTrace();
    System.out.println(HELP_MESSAGE);
  }
catch (  final IllegalArgumentException ex) {
    LOG.error("String_Node_Str",ex);
    if (ex.getMessage().startsWith("String_Node_Str")) {
      System.out.println(ex.getMessage());
    }
 else {
      System.out.println(HELP_MESSAGE);
    }
  }
}

Fixed version (ground truth):
public static void main(final String[] args){
  LOG.debug("String_Node_Str");
  try {
    ArgsManager.validator(args);
    final Input input=new Input(args);
    final AbstractCommand command=input.getCommand();
    command.execute(input);
  }
 catch (  final IllegalAccessException|InstantiationException e) {
    System.out.println(HELP_MESSAGE);
  }
catch (  final IllegalArgumentException ex) {
    LOG.error("String_Node_Str",ex);
    Messages.printMessage(ex.getMessage());
    if (!ex.getMessage().startsWith("String_Node_Str")) {
      System.out.println(HELP_MESSAGE);
    }
  }
}
Program: 60516
Project: 60516
Buggy source:
public boolean isMultivalue(){
  return Boolean.TRUE;
}

Fixed version (ground truth):
@Override public boolean isMultivalue(){
  return Boolean.TRUE;
}
Program: 60517
Project: 60517
Buggy source:
public boolean isReadonly(){
  return Boolean.FALSE;
}

Fixed version (ground truth):
@Override public boolean isReadonly(){
  return Boolean.FALSE;
}
Program: 60518
Project: 60518
Buggy source:
public AttributeSchemaType getType(){
  return AttributeSchemaType.String;
}

Fixed version (ground truth):
@Override public AttributeSchemaType getType(){
  return AttributeSchemaType.String;
}
Program: 60519
Project: 60519
Buggy source:
public boolean isMultivalue(){
  return isBooleanAsInteger(multivalue);
}

Fixed version (ground truth):
@Override public boolean isMultivalue(){
  return isBooleanAsInteger(multivalue);
}
Program: 60520
Project: 60520
Buggy source:
public boolean isReadonly(){
  return isBooleanAsInteger(readonly);
}

Fixed version (ground truth):
@Override public boolean isReadonly(){
  return isBooleanAsInteger(readonly);
}
Program: 60521
Project: 60521
Buggy source:
public AttributeSchemaType getType(){
  return type;
}

Fixed version (ground truth):
@Override public AttributeSchemaType getType(){
  return type;
}
Program: 60522
Project: 60522
Buggy source:
public boolean isMultivalue(){
  return Boolean.TRUE;
}

Fixed version (ground truth):
@Override public boolean isMultivalue(){
  return Boolean.TRUE;
}
Program: 60523
Project: 60523
Buggy source:
public boolean isReadonly(){
  return isBooleanAsInteger(readonly);
}

Fixed version (ground truth):
@Override public boolean isReadonly(){
  return isBooleanAsInteger(readonly);
}
Program: 60524
Project: 60524
Buggy source:
public AttributeSchemaType getType(){
  return AttributeSchemaType.String;
}

Fixed version (ground truth):
@Override public AttributeSchemaType getType(){
  return AttributeSchemaType.String;
}
Program: 60528
Project: 60528
Buggy source:
public static Object get(final Class claz){
  LOG.debug("String_Node_Str",claz.getName());
  return client.getService(claz);
}

Fixed version (ground truth):
public static Object get(final Class<?> claz){
  LOG.debug("String_Node_Str",claz.getName());
  return CLIENT.getService(claz);
}
Program: 60529
Project: 60529
Buggy source:
public CamelContext getContext(){
  return contextFactory.getContext(routeDAO);
}

Fixed version (ground truth):
public SpringCamelContext getContext(){
  return contextFactory.getContext(routeDAO);
}
Program: 60530
Project: 60530
Buggy source:
public CamelContext getContext(){
  return contextFactory.getContext(routeDAO);
}

Fixed version (ground truth):
public SpringCamelContext getContext(){
  return contextFactory.getContext(routeDAO);
}
Program: 60531
Project: 60531
Buggy source:
public CamelContext getContext(RouteDAO routeDAO){
  if (camelContext == null) {
    camelContext=new SpringCamelContext(ApplicationContextProvider.getApplicationContext());
  }
  if (camelContext.getRouteDefinitions().isEmpty()) {
    List<CamelRoute> crl=routeDAO.findAll();
    LOG.info("String_Node_Str",crl.size());
    loadContext(routeDAO,crl);
    try {
      camelContext.start();
    }
 catch (    Exception ex) {
      LOG.error("String_Node_Str",ex);
    }
  }
  return camelContext;
}

Fixed version (ground truth):
public SpringCamelContext getContext(RouteDAO routeDAO){
  if (camelContext == null) {
    camelContext=new SpringCamelContext(ApplicationContextProvider.getApplicationContext());
  }
  if (camelContext.getRouteDefinitions().isEmpty()) {
    List<CamelRoute> crl=routeDAO.findAll();
    LOG.info("String_Node_Str",crl.size());
    loadContext(routeDAO,crl);
    try {
      camelContext.start();
    }
 catch (    Exception ex) {
      LOG.error("String_Node_Str",ex);
    }
  }
  return camelContext;
}
Program: 60534
Project: 60534
Buggy source:
private NonI18nPalette<String> buildPalette(final Type type,final List<String> allSchemas){
  if (allSchemas != null && !allSchemas.isEmpty()) {
    Collections.sort(allSchemas);
  }
  ListModel<String> availableSchemas=new ListModel<String>(allSchemas);
  return new NonI18nPalette<String>(type.name(),new PropertyModel<List<String>>(roleTO,type.name()),availableSchemas,new SelectChoiceRenderer<String>(),8,false){
    private static final long serialVersionUID=2295567122085510330L;
    @Override protected Recorder<String> newRecorderComponent(){
      final Recorder<String> recorder=super.newRecorderComponent();
switch (type) {
case rAttrTemplates:
case rDerAttrTemplates:
case rVirAttrTemplates:
        recorder.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE){
          private static final long serialVersionUID=-1107858522700306810L;
          @Override protected void onUpdate(          final AjaxRequestTarget target){
            send(getPage(),Broadcast.BREADTH,new RoleAttrTemplatesChange(type,target));
          }
        }
);
      break;
default :
  }
  return recorder;
}
}
;
}

Fixed version (ground truth):
private NonI18nPalette<String> buildPalette(final Type type,final List<String> allSchemas){
  if (allSchemas != null && !allSchemas.isEmpty()) {
    Collections.sort(allSchemas);
  }
  ListModel<String> availableSchemas=new ListModel<String>(allSchemas);
  return new NonI18nPalette<String>(type.name(),new PropertyModel<List<String>>(roleTO,type.name()),availableSchemas,new SelectChoiceRenderer<String>(),8,false,true){
    private static final long serialVersionUID=2295567122085510330L;
    @Override protected Recorder<String> newRecorderComponent(){
      final Recorder<String> recorder=super.newRecorderComponent();
switch (type) {
case rAttrTemplates:
case rDerAttrTemplates:
case rVirAttrTemplates:
        recorder.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE){
          private static final long serialVersionUID=-1107858522700306810L;
          @Override protected void onUpdate(          final AjaxRequestTarget target){
            send(getPage(),Broadcast.BREADTH,new RoleAttrTemplatesChange(type,target));
          }
        }
);
      break;
default :
  }
  return recorder;
}
}
;
}
Program: 60535
Project: 60535
Buggy source:
@Before public void setupSMTP() throws Exception {
  JavaMailSenderImpl sender=(JavaMailSenderImpl)mailSender;
  sender.setDefaultEncoding(SyncopeConstants.DEFAULT_ENCODING);
  sender.setHost(SMTP_HOST);
  sender.setPort(SMTP_PORT);
  sender.setUsername(MAIL_ADDRESS);
  sender.setPassword(MAIL_PASSWORD);
}

Fixed version (ground truth):
@Before public void setupSMTP() throws Exception {
  JavaMailSenderImpl sender=(JavaMailSenderImpl)mailSender;
  sender.setDefaultEncoding(SyncopeConstants.DEFAULT_ENCODING);
  sender.setHost(SMTP_HOST);
  sender.setPort(SMTP_PORT);
}
Program: 60536
Project: 60536
Buggy source:
public void run(final AbstractUIProcessHandler handler,final String[] args){
  final String installPath=args[0];
  final String mavenDir=args[1];
  final String groupId=args[2];
  final String artifactId=args[3];
  final String secretKey=args[4];
  final String anonymousKey=args[5];
  final String confDirectory=args[6];
  final String logsDirectory=args[7];
  final String bundlesDirectory=args[8];
  final String syncopeVersion=args[9];
  final String syncopeAdminPassword=args[10];
  final FileSystemUtils fileSystemUtils=new FileSystemUtils(handler);
  if (!new File(installPath).exists()) {
    fileSystemUtils.createDirectory(installPath,null);
    InstallLog.initialize(installPath,handler);
  }
  final MavenUtils mavenUtils=new MavenUtils(mavenDir,handler);
  mavenUtils.archetypeGenerate(syncopeVersion,groupId,artifactId,secretKey,anonymousKey,installPath);
  fileSystemUtils.writeToFile(new File(installPath + "String_Node_Str" + artifactId+ Pom.PATH),String.format(Pom.FILE,syncopeVersion,syncopeVersion,groupId,artifactId));
  fileSystemUtils.createDirectory(confDirectory,null);
  fileSystemUtils.createDirectory(logsDirectory,null);
  fileSystemUtils.createDirectory(bundlesDirectory,null);
  mavenUtils.createPackage(installPath + "String_Node_Str" + artifactId,confDirectory,logsDirectory,bundlesDirectory);
}

Fixed version (ground truth):
public void run(final AbstractUIProcessHandler handler,final String[] args){
  final String installPath=args[0];
  final String mavenDir=args[1];
  final String groupId=args[2];
  final String artifactId=args[3];
  final String secretKey=args[4];
  final String anonymousKey=args[5];
  final String confDirectory=args[6];
  final String logsDirectory=args[7];
  final String bundlesDirectory=args[8];
  final String syncopeVersion=args[9];
  final String syncopeAdminPassword=args[10];
  final FileSystemUtils fileSystemUtils=new FileSystemUtils(handler);
  if (!new File(installPath).exists()) {
    fileSystemUtils.createDirectory(installPath,null);
    InstallLog.initialize(installPath,handler);
  }
 else {
    InstallLog.initialize(installPath,handler);
  }
  final MavenUtils mavenUtils=new MavenUtils(mavenDir,handler);
  mavenUtils.archetypeGenerate(syncopeVersion,groupId,artifactId,secretKey,anonymousKey,installPath);
  fileSystemUtils.writeToFile(new File(installPath + "String_Node_Str" + artifactId+ Pom.PATH),String.format(Pom.FILE,syncopeVersion,syncopeVersion,groupId,artifactId));
  fileSystemUtils.createDirectory(confDirectory,null);
  fileSystemUtils.createDirectory(logsDirectory,null);
  fileSystemUtils.createDirectory(bundlesDirectory,null);
  mavenUtils.createPackage(installPath + "String_Node_Str" + artifactId,confDirectory,logsDirectory,bundlesDirectory);
}
Program: 60537
Project: 60537
Buggy source:
public void run(final AbstractUIProcessHandler handler,final String[] args){
  final String installPath=args[0];
  final String mavenDir=args[1];
  final String groupId=args[2];
  final String artifactId=args[3];
  final String secretKey=args[4];
  final String anonymousKey=args[5];
  final String logsDirectory=args[6];
  final String bundlesDirectory=args[7];
  final String syncopeVersion=args[8];
  final String syncopeAdminPassword=args[9];
  if (!new File(installPath).exists()) {
    FileSystemUtils.createDirectory(installPath,handler,null);
  }
  final MavenUtils mavenUtils=new MavenUtils(mavenDir);
  mavenUtils.archetypeGenerate(syncopeVersion,groupId,artifactId,secretKey,anonymousKey,installPath);
  FileSystemUtils.writeToFile(new File(installPath + "String_Node_Str" + artifactId+ Pom.PATH),String.format(Pom.FILE,syncopeVersion,syncopeVersion));
  FileSystemUtils.createDirectory(logsDirectory,handler,null);
  FileSystemUtils.createDirectory(bundlesDirectory,handler,null);
  mavenUtils.createPackage(installPath + "String_Node_Str" + artifactId,logsDirectory,bundlesDirectory);
}

Fixed version (ground truth):
public void run(final AbstractUIProcessHandler handler,final String[] args){
  final String installPath=args[0];
  final String mavenDir=args[1];
  final String groupId=args[2];
  final String artifactId=args[3];
  final String secretKey=args[4];
  final String anonymousKey=args[5];
  final String confDirectory=args[6];
  final String logsDirectory=args[7];
  final String bundlesDirectory=args[8];
  final String syncopeVersion=args[9];
  final String syncopeAdminPassword=args[10];
  if (!new File(installPath).exists()) {
    FileSystemUtils.createDirectory(installPath,handler,null);
  }
  final MavenUtils mavenUtils=new MavenUtils(mavenDir);
  mavenUtils.archetypeGenerate(syncopeVersion,groupId,artifactId,secretKey,anonymousKey,installPath);
  FileSystemUtils.writeToFile(new File(installPath + "String_Node_Str" + artifactId+ Pom.PATH),String.format(Pom.FILE,syncopeVersion,syncopeVersion,groupId,artifactId));
  FileSystemUtils.createDirectory(logsDirectory,handler,null);
  FileSystemUtils.createDirectory(bundlesDirectory,handler,null);
  mavenUtils.createPackage(installPath + "String_Node_Str" + artifactId,confDirectory,logsDirectory,bundlesDirectory);
}
Program: 60538
Project: 60538
Buggy source:
@XmlElementWrapper(name="String_Node_Str") @XmlElement(name="String_Node_Str") public List<Object> getValues(){
  return values;
}

Fixed version (ground truth):
@XmlElementWrapper(name="String_Node_Str") @XmlElement(name="String_Node_Str") @JsonProperty("String_Node_Str") public List<Object> getValues(){
  return values;
}
Program: 60539
Project: 60539
Buggy source:
private List<ConnConfProperty> fillProperties(final ConnBundleTO bundleTO,final ConnInstanceTO connInstanceTO){
  final List<ConnConfProperty> props=new ArrayList<ConnConfProperty>();
  if (bundleTO != null) {
    for (    ConnConfPropSchema key : bundleTO.getProperties()) {
      final ConnConfProperty property=new ConnConfProperty();
      property.setSchema(key);
      if (connInstanceTO.getId() != 0 && connInstanceTO.getConfigurationMap().containsKey(key.getName())) {
        property.getValues().addAll(connInstanceTO.getConfigurationMap().get(key.getName()).getValues());
        property.setOverridable(connInstanceTO.getConfigurationMap().get(key.getName()).isOverridable());
      }
      if (property.getValues() == null || property.getValues().isEmpty() && key.getDefaultValue() != null) {
        if (key.getDefaultValue().getClass().isArray()) {
          property.getValues().addAll(Arrays.asList((Object[])key.getDefaultValue()));
        }
 else         if (key.getDefaultValue() instanceof Collection<?>) {
          property.getValues().addAll((Collection<?>)key.getDefaultValue());
        }
 else {
          property.getValues().add(key.getDefaultValue());
        }
      }
      props.add(property);
    }
  }
  Collections.sort(props);
  return props;
}

Fixed version (ground truth):
private List<ConnConfProperty> fillProperties(final ConnBundleTO bundleTO,final ConnInstanceTO connInstanceTO){
  final List<ConnConfProperty> props=new ArrayList<ConnConfProperty>();
  if (bundleTO != null) {
    for (    ConnConfPropSchema key : bundleTO.getProperties()) {
      final ConnConfProperty property=new ConnConfProperty();
      property.setSchema(key);
      if (connInstanceTO.getId() != 0 && connInstanceTO.getConfigurationMap().containsKey(key.getName())) {
        property.getValues().addAll(connInstanceTO.getConfigurationMap().get(key.getName()).getValues());
        property.setOverridable(connInstanceTO.getConfigurationMap().get(key.getName()).isOverridable());
      }
      if (property.getValues().isEmpty() && !key.getDefaultValues().isEmpty()) {
        property.getValues().addAll(key.getDefaultValues());
      }
      props.add(property);
    }
  }
  Collections.sort(props);
  return props;
}
Program: 60540
Project: 60540
Buggy source:
private Set<ConnConfProperty> filterProperties(final Set<ConnConfProperty> properties){
  Set<ConnConfProperty> newProperties=new HashSet<ConnConfProperty>();
  for (  ConnConfProperty property : properties) {
    ConnConfProperty prop=new ConnConfProperty();
    prop.setSchema(property.getSchema());
    prop.setOverridable(property.isOverridable());
    final List<Object> parsed=new ArrayList<Object>();
    if (property.getValues() != null) {
      for (      Object obj : property.getValues()) {
        if (obj != null && !obj.toString().isEmpty()) {
          parsed.add(obj);
        }
      }
    }
    prop.setValues(parsed);
    newProperties.add(prop);
  }
  return newProperties;
}

Fixed version (ground truth):
private Set<ConnConfProperty> filterProperties(final Set<ConnConfProperty> properties){
  Set<ConnConfProperty> newProperties=new HashSet<ConnConfProperty>();
  for (  ConnConfProperty property : properties) {
    ConnConfProperty prop=new ConnConfProperty();
    prop.setSchema(property.getSchema());
    prop.setOverridable(property.isOverridable());
    final List<Object> parsed=new ArrayList<Object>();
    if (property.getValues() != null) {
      for (      Object obj : property.getValues()) {
        if (obj != null && !obj.toString().isEmpty()) {
          parsed.add(obj);
        }
      }
    }
    prop.getValues().clear();
    prop.getValues().addAll(parsed);
    newProperties.add(prop);
  }
  return newProperties;
}
Program: 60542
Project: 60542
Buggy source:
public ConnInstance getConnInstance(final ConnInstanceTO connInstanceTO){
  SyncopeClientCompositeErrorException scee=new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
  SyncopeClientException requiredValuesMissing=new SyncopeClientException(SyncopeClientExceptionType.RequiredValuesMissing);
  if (connInstanceTO.getLocation() == null) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  if (connInstanceTO.getBundleName() == null) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  if (connInstanceTO.getVersion() == null) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  if (connInstanceTO.getConnectorName() == null) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  if (connInstanceTO.getConfiguration() == null || connInstanceTO.getConfiguration().isEmpty()) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  ConnInstance connInstance=new ConnInstance();
  BeanUtils.copyProperties(connInstanceTO,connInstance,IGNORE_PROPERTIES);
  if (connInstanceTO.getLocation() != null) {
    connInstance.setLocation(connInstanceTO.getLocation().toString());
  }
  if (!requiredValuesMissing.isEmpty()) {
    scee.addException(requiredValuesMissing);
  }
  if (scee.hasExceptions()) {
    throw scee;
  }
  return connInstance;
}

Fixed version (ground truth):
public ConnInstance getConnInstance(final ConnInstanceTO connInstanceTO){
  SyncopeClientCompositeErrorException scee=new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
  SyncopeClientException requiredValuesMissing=new SyncopeClientException(SyncopeClientExceptionType.RequiredValuesMissing);
  if (connInstanceTO.getLocation() == null) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  if (connInstanceTO.getBundleName() == null) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  if (connInstanceTO.getVersion() == null) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  if (connInstanceTO.getConnectorName() == null) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  if (connInstanceTO.getConfiguration() == null || connInstanceTO.getConfiguration().isEmpty()) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  ConnInstance connInstance=new ConnInstance();
  BeanUtils.copyProperties(connInstanceTO,connInstance,IGNORE_PROPERTIES);
  if (connInstanceTO.getLocation() != null) {
    connInstance.setLocation(connInstanceTO.getLocation());
  }
  if (!requiredValuesMissing.isEmpty()) {
    scee.addException(requiredValuesMissing);
  }
  if (scee.hasExceptions()) {
    throw scee;
  }
  return connInstance;
}