nus-yam/ex-repair huggingface dataset:
Program: 63878
Project: 63878
Buggy source:
@Test public void testCreateImageFoundNoStackStatusUpdate(){
  when(connector.checkAndGetPlatformVariant(stack)).thenReturn(variant);
  when(variant.value()).thenReturn(VARIANT_VALUE);
  when(stack.getStackAuthentication()).thenReturn(stackAuthentication);
  when(stackAuthentication.passwordAuthenticationRequired()).thenReturn(false);
  when(stackRepository.save(stack)).thenReturn(stack);
  when(tlsSecurityService.storeSSHKeys()).thenReturn(securityConfig);
  when(connector.getPlatformParameters(stack)).thenReturn(parameters);
  try {
    Optional<String> imageId=Optional.of("String_Node_Str");
    stack=underTest.create(user,stack,"String_Node_Str",mock(StatedImage.class));
  }
  finally {
    verify(stack,times(1)).setPlatformVariant(eq(VARIANT_VALUE));
    verify(securityConfig,times(1)).setSaltPassword(anyObject());
    verify(securityConfig,times(1)).setSaltBootPassword(anyObject());
    verify(securityConfig,times(1)).setKnoxMasterSecret(anyObject());
    verify(securityConfig,times(1)).setStack(stack);
    verify(securityConfigRepository,times(1)).save(securityConfig);
    verify(stackUpdater,times(0)).updateStackStatus(eq(Long.MAX_VALUE),eq(DetailedStackStatus.PROVISION_FAILED),anyString());
  }
}

Fixed version (ground truth):
@Test public void testCreateImageFoundNoStackStatusUpdate(){
  when(connector.checkAndGetPlatformVariant(stack)).thenReturn(variant);
  when(variant.value()).thenReturn(VARIANT_VALUE);
  when(stack.getStackAuthentication()).thenReturn(stackAuthentication);
  when(stackAuthentication.passwordAuthenticationRequired()).thenReturn(false);
  when(stackRepository.save(stack)).thenReturn(stack);
  when(tlsSecurityService.storeSSHKeys()).thenReturn(securityConfig);
  when(connector.getPlatformParameters(stack)).thenReturn(parameters);
  try {
    stack=underTest.create(user,stack,"String_Node_Str",mock(StatedImage.class));
  }
  finally {
    verify(stack,times(1)).setPlatformVariant(eq(VARIANT_VALUE));
    verify(securityConfig,times(1)).setSaltPassword(anyObject());
    verify(securityConfig,times(1)).setSaltBootPassword(anyObject());
    verify(securityConfig,times(1)).setKnoxMasterSecret(anyObject());
    verify(securityConfig,times(1)).setStack(stack);
    verify(securityConfigRepository,times(1)).save(securityConfig);
    verify(stackUpdater,times(0)).updateStackStatus(eq(Long.MAX_VALUE),eq(DetailedStackStatus.PROVISION_FAILED),anyString());
  }
}
Program: 63879
Project: 63879
Buggy source:
public String resolveTypeForKerberos(KerberosConfig kerberosConfig){
  if (!Strings.isNullOrEmpty(kerberosConfig.getContainerDn()) && !Strings.isNullOrEmpty(kerberosConfig.getLdapUrl())) {
    return "String_Node_Str";
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public String resolveTypeForKerberos(@Nonnull KerberosConfig kerberosConfig){
  if (!Strings.isNullOrEmpty(kerberosConfig.getContainerDn()) && !Strings.isNullOrEmpty(kerberosConfig.getLdapUrl())) {
    return "String_Node_Str";
  }
  return "String_Node_Str";
}
Program: 63880
Project: 63880
Buggy source:
public String resolvePrincipalForKerberos(KerberosConfig kerberosConfig){
  return Strings.isNullOrEmpty(kerberosConfig.getPrincipal()) ? kerberosConfig.getAdmin() + PRINCIPAL : kerberosConfig.getPrincipal();
}

Fixed version (ground truth):
public String resolvePrincipalForKerberos(@Nonnull KerberosConfig kerberosConfig){
  return Strings.isNullOrEmpty(kerberosConfig.getPrincipal()) ? kerberosConfig.getAdmin() + PRINCIPAL : kerberosConfig.getPrincipal();
}
Program: 63881
Project: 63881
Buggy source:
public String resolveLdapUrlForKerberos(KerberosConfig kerberosConfig){
  return Strings.isNullOrEmpty(kerberosConfig.getLdapUrl()) ? null : kerberosConfig.getLdapUrl();
}

Fixed version (ground truth):
public String resolveLdapUrlForKerberos(@Nonnull KerberosConfig kerberosConfig){
  return Strings.isNullOrEmpty(kerberosConfig.getLdapUrl()) ? null : kerberosConfig.getLdapUrl();
}
Program: 63882
Project: 63882
Buggy source:
public Map<String,Object> getKerberosEnvProperties(KerberosConfig kerberosConfig){
  Map<String,Object> kerberosEnv=(Map<String,Object>)gson.fromJson(kerberosConfig.getDescriptor(),Map.class).get("String_Node_Str");
  return (Map<String,Object>)kerberosEnv.get("String_Node_Str");
}

Fixed version (ground truth):
public Map<String,Object> getKerberosEnvProperties(@Nonnull KerberosConfig kerberosConfig){
  Map<String,Object> kerberosEnv=(Map<String,Object>)gson.fromJson(kerberosConfig.getDescriptor(),Map.class).get("String_Node_Str");
  return (Map<String,Object>)kerberosEnv.get("String_Node_Str");
}
Program: 63883
Project: 63883
Buggy source:
public String resolveHostForKdcAdmin(KerberosConfig kerberosConfig,String defaultHost){
  return Strings.isNullOrEmpty(kerberosConfig.getAdminUrl()) ? defaultHost : kerberosConfig.getAdminUrl();
}

Fixed version (ground truth):
public String resolveHostForKdcAdmin(@Nonnull KerberosConfig kerberosConfig,String defaultHost){
  String adminHost=Optional.ofNullable(kerberosConfig.getAdminUrl()).orElse("String_Node_Str").trim();
  return adminHost.isEmpty() ? defaultHost : adminHost;
}
Program: 63884
Project: 63884
Buggy source:
public boolean isAmbariManagedKerberosPackages(KerberosConfig kerberosConfig) throws IOException {
  if (!StringUtils.hasLength(kerberosConfig.getDescriptor())) {
    return true;
  }
  try {
    JsonNode node=JsonUtil.readTree(kerberosConfig.getDescriptor()).get("String_Node_Str").get("String_Node_Str").get("String_Node_Str");
    return node.asBoolean();
  }
 catch (  NullPointerException ignored) {
    return true;
  }
}

Fixed version (ground truth):
public boolean isAmbariManagedKerberosPackages(@Nonnull KerberosConfig kerberosConfig) throws IOException {
  if (isEmpty(kerberosConfig.getDescriptor())) {
    return true;
  }
  try {
    JsonNode node=JsonUtil.readTree(kerberosConfig.getDescriptor()).get("String_Node_Str").get("String_Node_Str").get("String_Node_Str");
    return node.asBoolean();
  }
 catch (  NullPointerException ignored) {
    return true;
  }
}
Program: 63885
Project: 63885
Buggy source:
public String getRealm(String gwDomain,KerberosConfig kerberosConfig){
  return Strings.isNullOrEmpty(kerberosConfig.getRealm()) ? gwDomain.toUpperCase() : kerberosConfig.getRealm().toUpperCase();
}

Fixed version (ground truth):
public String getRealm(@Nonnull String gwDomain,@Nonnull KerberosConfig kerberosConfig){
  return Strings.isNullOrEmpty(kerberosConfig.getRealm()) ? gwDomain.toUpperCase() : kerberosConfig.getRealm().toUpperCase();
}
Program: 63886
Project: 63886
Buggy source:
public String resolveContainerDnForKerberos(KerberosConfig kerberosConfig){
  return Strings.isNullOrEmpty(kerberosConfig.getContainerDn()) ? null : kerberosConfig.getContainerDn();
}

Fixed version (ground truth):
public String resolveContainerDnForKerberos(@Nonnull KerberosConfig kerberosConfig){
  return Strings.isNullOrEmpty(kerberosConfig.getContainerDn()) ? null : kerberosConfig.getContainerDn();
}
Program: 63887
Project: 63887
Buggy source:
public String resolveHostForKerberos(KerberosConfig kerberosConfig,String defaultHost){
  return Strings.isNullOrEmpty(kerberosConfig.getUrl()) ? defaultHost : kerberosConfig.getUrl();
}

Fixed version (ground truth):
public String resolveHostForKerberos(@Nonnull KerberosConfig kerberosConfig,String defaultHost){
  String host=Optional.ofNullable(kerberosConfig.getUrl()).orElse("String_Node_Str").trim();
  return host.isEmpty() ? defaultHost : host;
}
Program: 63888
Project: 63888
Buggy source:
@Test public void testAmbariManagedKerberosFalse() throws IOException {
  KerberosConfig config=new KerberosConfig();
  config.setDescriptor("String_Node_Str");
  Assert.assertFalse(underTest.isAmbariManagedKerberosPackages(config));
}

Fixed version (ground truth):
@Test public void testAmbariManagedKerberosFalse() throws IOException {
  config.setDescriptor("String_Node_Str");
  Assert.assertFalse(underTest.isAmbariManagedKerberosPackages(config));
}
Program: 63889
Project: 63889
Buggy source:
@Test public void testAmbariManagedKerberosTrue() throws IOException {
  KerberosConfig config=new KerberosConfig();
  config.setDescriptor("String_Node_Str");
  Assert.assertTrue(underTest.isAmbariManagedKerberosPackages(config));
}

Fixed version (ground truth):
@Test public void testAmbariManagedKerberosTrue() throws IOException {
  config.setDescriptor("String_Node_Str");
  Assert.assertTrue(underTest.isAmbariManagedKerberosPackages(config));
}
Program: 63890
Project: 63890
Buggy source:
@Test public void testAmbariManagedKerberosMissing() throws IOException {
  KerberosConfig config=new KerberosConfig();
  Assert.assertTrue(underTest.isAmbariManagedKerberosPackages(config));
}

Fixed version (ground truth):
@Test public void testAmbariManagedKerberosMissing() throws IOException {
  Assert.assertTrue(underTest.isAmbariManagedKerberosPackages(config));
}
Program: 63892
Project: 63892
Buggy source:
public RdsView(RDSConfig rdsConfig){
  connectionURL=rdsConfig.getConnectionURL();
  connectionUserName=rdsConfig.getConnectionUserName();
  connectionPassword=rdsConfig.getConnectionPassword();
  String[] split=connectionURL.split("String_Node_Str");
  String withoutJDBCPrefix=split[split.length - 1];
  String hostWithPort=withoutJDBCPrefix.split("String_Node_Str")[0];
  int portDelimiterIndex=hostWithPort.indexOf(':');
  if (portDelimiterIndex > 0) {
    host=hostWithPort.substring(0,portDelimiterIndex);
    port=hostWithPort.substring(portDelimiterIndex + 1);
  }
 else {
    host=hostWithPort;
    port="String_Node_Str";
  }
  databaseName=getDatabaseName(connectionURL);
  hostWithPortWithJdbc=connectionURL.replace("String_Node_Str" + databaseName,"String_Node_Str");
  this.hostWithPort=createConnectionHost(port);
  connectionDriver=rdsConfig.getConnectionDriver();
  subprotocol=getSubprotocol(connectionURL);
  if (rdsConfig.getDatabaseEngine() != null) {
    lowerCaseDatabaseEngine=rdsConfig.getDatabaseEngine().toLowerCase();
    DatabaseVendor databaseVendor=DatabaseVendor.valueOf(rdsConfig.getDatabaseEngine());
    fancyName=databaseVendor.fancyName();
    ambariVendor=databaseVendor.ambariVendor();
    databaseType=databaseVendor.databaseType();
    upperCaseDatabaseEngine=rdsConfig.getDatabaseEngine().toUpperCase();
  }
}

Fixed version (ground truth):
public RdsView(RDSConfig rdsConfig){
  connectionURL=rdsConfig.getConnectionURL();
  connectionUserName=rdsConfig.getConnectionUserName();
  userName=connectionUserName;
  connectionPassword=rdsConfig.getConnectionPassword();
  password=connectionPassword;
  String[] split=connectionURL.split("String_Node_Str");
  String withoutJDBCPrefix=split[split.length - 1];
  String hostWithPort=withoutJDBCPrefix.split("String_Node_Str")[0];
  int portDelimiterIndex=hostWithPort.indexOf(':');
  if (portDelimiterIndex > 0) {
    host=hostWithPort.substring(0,portDelimiterIndex);
    port=hostWithPort.substring(portDelimiterIndex + 1);
  }
 else {
    host=hostWithPort;
    port="String_Node_Str";
  }
  databaseName=getDatabaseName(connectionURL);
  name=databaseName;
  hostWithPortWithJdbc=connectionURL.replace("String_Node_Str" + databaseName,"String_Node_Str");
  this.hostWithPort=createConnectionHost(port);
  connectionDriver=rdsConfig.getConnectionDriver();
  subprotocol=getSubprotocol(connectionURL);
  if (rdsConfig.getDatabaseEngine() != null) {
    lowerCaseDatabaseEngine=rdsConfig.getDatabaseEngine().toLowerCase();
    DatabaseVendor databaseVendor=DatabaseVendor.valueOf(rdsConfig.getDatabaseEngine());
    fancyName=databaseVendor.fancyName();
    ambariVendor=databaseVendor.ambariVendor();
    vendor=ambariVendor;
    databaseType=databaseVendor.databaseType();
    upperCaseDatabaseEngine=rdsConfig.getDatabaseEngine().toUpperCase();
  }
}
Program: 63893
Project: 63893
Buggy source:
@Override public Boolean call() throws Exception {
  count++;
  if (count != retryOk) {
    throw new CloudbreakException("String_Node_Str");
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  count++;
  if (count != retryOk) {
    throw new CloudbreakException(EXCEPTION_MESSAGE);
  }
 else {
    return true;
  }
}
Program: 63895
Project: 63895
Buggy source:
@Override public Boolean call() throws Exception {
  count++;
  if (count != retryOk) {
    throw new CloudbreakException("String_Node_Str");
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  count++;
  if (count != retryOk) {
    throw new CloudbreakException(EXCEPTION_MESSAGE);
  }
 else {
    return true;
  }
}
Program: 63897
Project: 63897
Buggy source:
private void validateImageOptIn(AwsCredentialView credentialView,String region,String imageName){
  try {
    AmazonEC2Client amazonEC2Client=awsClient.createAccess(credentialView,region);
    RunInstancesRequest request=new RunInstancesRequest().withMinCount(1).withMaxCount(1).withImageId(imageName).withInstanceType(InstanceType.M3Xlarge);
    amazonEC2Client.dryRun(request);
    LOGGER.info("String_Node_Str",imageName);
  }
 catch (  AmazonServiceException e) {
    String errorMessage=e.getErrorMessage();
    if (e.getErrorCode().equals("String_Node_Str")) {
      int marketplaceLinkIndex=errorMessage.indexOf(MARKETPLACE_HTTP_LINK);
      if (marketplaceLinkIndex != -1) {
        errorMessage=IMAGE_OPT_IN_REQUIRED_MSG + "String_Node_Str" + LINK_TO_MARKETPLACE_MSG+ errorMessage.substring(marketplaceLinkIndex);
      }
 else {
        errorMessage=IMAGE_OPT_IN_REQUIRED_MSG;
      }
      throw new CloudConnectorException(errorMessage,e);
    }
 else {
      LOGGER.error(String.format("String_Node_Str",imageName),e);
    }
  }
}

Fixed version (ground truth):
private void validateImageOptIn(AwsCredentialView credentialView,String region,String imageName){
  try {
    AmazonEC2Client amazonEC2Client=awsClient.createAccess(credentialView,region);
    RunInstancesRequest request=new RunInstancesRequest().withMinCount(1).withMaxCount(1).withImageId(imageName).withInstanceType(InstanceType.M3Xlarge);
    amazonEC2Client.dryRun(request);
    LOGGER.info("String_Node_Str",imageName);
  }
 catch (  AmazonClientException ex) {
    if (ex.getCause() != null && (ex.getCause() instanceof AmazonEC2Exception)) {
      AmazonEC2Exception e=(AmazonEC2Exception)ex.getCause();
      String errorMessage=e.getErrorMessage();
      if (e.getErrorCode().equals("String_Node_Str")) {
        int marketplaceLinkIndex=errorMessage.indexOf(MARKETPLACE_HTTP_LINK);
        if (marketplaceLinkIndex != -1) {
          errorMessage=IMAGE_OPT_IN_REQUIRED_MSG + "String_Node_Str" + LINK_TO_MARKETPLACE_MSG+ errorMessage.substring(marketplaceLinkIndex);
        }
 else {
          errorMessage=IMAGE_OPT_IN_REQUIRED_MSG;
        }
        throw new CloudConnectorException(errorMessage,e);
      }
    }
    LOGGER.error(String.format("String_Node_Str",imageName),ex);
  }
catch (  Exception e) {
    LOGGER.error(String.format("String_Node_Str",imageName),e);
  }
}
Program: 63898
Project: 63898
Buggy source:
@Override public List<CloudVmInstanceStatus> check(AuthenticatedContext ac,List<CloudInstance> vms){
  List<CloudVmInstanceStatus> statuses=new ArrayList<>();
  String stackName=armTemplateUtils.getStackName(ac.getCloudContext());
  for (  CloudInstance vm : vms) {
    try {
      AzureClient azureClient=ac.getParameter(AzureClient.class);
      PowerState virtualMachinePowerState=azureClient.getVirtualMachinePowerState(stackName,vm.getInstanceId());
      statuses.add(new CloudVmInstanceStatus(vm,AzureInstanceStatus.get(virtualMachinePowerState)));
    }
 catch (    CloudException e) {
      if (e.getBody() != null && "String_Node_Str".equals(e.getBody().getCode())) {
        statuses.add(new CloudVmInstanceStatus(vm,InstanceStatus.TERMINATED));
      }
 else {
        statuses.add(new CloudVmInstanceStatus(vm,InstanceStatus.UNKNOWN));
      }
    }
catch (    Exception e) {
      statuses.add(new CloudVmInstanceStatus(vm,InstanceStatus.UNKNOWN));
    }
  }
  return statuses;
}

Fixed version (ground truth):
@Override public List<CloudVmInstanceStatus> check(AuthenticatedContext ac,List<CloudInstance> vms){
  List<CloudVmInstanceStatus> statuses=new ArrayList<>();
  String stackName=armTemplateUtils.getStackName(ac.getCloudContext());
  for (  CloudInstance vm : vms) {
    try {
      AzureClient azureClient=ac.getParameter(AzureClient.class);
      PowerState virtualMachinePowerState=azureClient.getVirtualMachinePowerState(stackName,vm.getInstanceId());
      statuses.add(new CloudVmInstanceStatus(vm,AzureInstanceStatus.get(virtualMachinePowerState)));
    }
 catch (    CloudException e) {
      if (e.body() != null && "String_Node_Str".equals(e.body().code())) {
        statuses.add(new CloudVmInstanceStatus(vm,InstanceStatus.TERMINATED));
      }
 else {
        statuses.add(new CloudVmInstanceStatus(vm,InstanceStatus.UNKNOWN));
      }
    }
catch (    Exception e) {
      statuses.add(new CloudVmInstanceStatus(vm,InstanceStatus.UNKNOWN));
    }
  }
  return statuses;
}
Program: 63900
Project: 63900
Buggy source:
public void triggerTermination(Long stackId,Boolean deleteDependencies){
  Stack stack=stackService.get(stackId);
  if (BYOS.equals(stack.cloudPlatform())) {
    String selector=FlowChainTriggers.BYOS_CLUSTER_TERMINATION_TRIGGER_EVENT;
    notify(selector,new TerminationEvent(selector,stackId,null,deleteDependencies));
  }
 else {
    String selector=StackTerminationEvent.TERMINATION_EVENT.event();
    notify(selector,new TerminationEvent(selector,stackId,deleteDependencies));
  }
  cancelRunningFlows(stackId);
}

Fixed version (ground truth):
public void triggerTermination(Long stackId,Boolean deleteDependencies){
  Stack stack=stackService.getById(stackId);
  if (BYOS.equals(stack.cloudPlatform())) {
    String selector=FlowChainTriggers.BYOS_CLUSTER_TERMINATION_TRIGGER_EVENT;
    notify(selector,new TerminationEvent(selector,stackId,null,deleteDependencies));
  }
 else {
    String selector=StackTerminationEvent.TERMINATION_EVENT.event();
    notify(selector,new TerminationEvent(selector,stackId,deleteDependencies));
  }
  cancelRunningFlows(stackId);
}
Program: 63901
Project: 63901
Buggy source:
@Before public void setUp(){
  reset(reactor);
  reset(eventFactory);
  when(reactor.notify((Object)anyObject(),any(Event.class))).thenReturn(new EventBus(new ThreadPoolExecutorDispatcher(1,1)));
  Acceptable acceptable=new Acceptable(){
    @Override public Promise<Boolean> accepted(){
      Promise<Boolean> a=new Promise<>();
      a.accept(true);
      return a;
    }
    @Override public Long getStackId(){
      return stackId;
    }
  }
;
  when(stackService.get(anyLong())).thenReturn(TestUtil.stack());
  when(eventFactory.createEvent(anyObject())).thenReturn(new Event<>(acceptable));
}

Fixed version (ground truth):
@Before public void setUp(){
  reset(reactor);
  reset(eventFactory);
  when(reactor.notify((Object)anyObject(),any(Event.class))).thenReturn(new EventBus(new ThreadPoolExecutorDispatcher(1,1)));
  Acceptable acceptable=new Acceptable(){
    @Override public Promise<Boolean> accepted(){
      Promise<Boolean> a=new Promise<>();
      a.accept(true);
      return a;
    }
    @Override public Long getStackId(){
      return stackId;
    }
  }
;
  when(stackService.get(anyLong())).thenReturn(TestUtil.stack());
  when(stackService.getById(anyLong())).thenReturn(TestUtil.stack());
  when(eventFactory.createEvent(anyObject())).thenReturn(new Event<>(acceptable));
}
Program: 63902
Project: 63902
Buggy source:
@Override public Template decorate(final Template subject,Object... data){
  Supplier<VolumeParameterConfig> config=Suppliers.memoize(() -> {
    Platform platform=Platform.platform(subject.cloudPlatform());
    VmType vmType=virtualMachines.get().get(platform).stream().filter(curr -> curr.value().equals(subject.getInstanceType())).findFirst().get();
    Map<String,VolumeParameterType> map=diskMappings.get().get(platform);
    VolumeParameterType volumeParameterType=map.get(subject.getVolumeType());
    return vmType.getVolumeParameterbyVolumeParameterType(volumeParameterType);
  }
);
  if (subject.getVolumeCount() == null) {
    subject.setVolumeCount(config.get().maximumNumber());
  }
  if (subject.getVolumeSize() == null) {
    subject.setVolumeSize(config.get().maximumSize());
  }
  return subject;
}

Fixed version (ground truth):
@Override public Template decorate(final Template subject,Object... data){
  Supplier<VolumeParameterConfig> config=Suppliers.memoize(() -> {
    try {
      Platform platform=Platform.platform(subject.cloudPlatform());
      VmType vmType=virtualMachines.get().get(platform).stream().filter(curr -> curr.value().equals(subject.getInstanceType())).findFirst().get();
      Map<String,VolumeParameterType> map=diskMappings.get().get(platform);
      VolumeParameterType volumeParameterType=map.get(subject.getVolumeType());
      return vmType.getVolumeParameterbyVolumeParameterType(volumeParameterType);
    }
 catch (    NoSuchElementException e) {
      LOGGER.info("String_Node_Str");
      return VolumeParameterConfig.EMPTY;
    }
  }
);
  if (config.get().volumeParameterType() != null) {
    if (subject.getVolumeCount() == null) {
      subject.setVolumeCount(config.get().maximumNumber());
    }
    if (subject.getVolumeSize() == null) {
      subject.setVolumeSize(config.get().maximumSize());
    }
  }
  return subject;
}
Program: 63903
Project: 63903
Buggy source:
private void checkJobFinishedWithSuccess(){
  String jobId=saltJobRunner.getJid().getJobId();
  try {
    Multimap<String,String> missingNodesWithReason=SaltStates.jidInfo(saltConnector,jobId,new Compound(saltJobRunner.getTarget()),saltJobRunner.stateType());
    if (!missingNodesWithReason.isEmpty()) {
      LOGGER.info("String_Node_Str",jobId,String.join("String_Node_Str",missingNodesWithReason.keySet()));
      JobState jobState=JobState.FAILED;
      jobState.setNodesWithError(missingNodesWithReason);
      saltJobRunner.setJobState(JobState.FAILED);
      Set<String> newTargets=missingNodesWithReason.keySet().stream().map(node -> SaltStates.resolveHostNameToMinionHostName(saltConnector,node)).collect(Collectors.toSet());
      saltJobRunner.setTarget(newTargets);
    }
 else {
      LOGGER.info("String_Node_Str",jobId);
      saltJobRunner.setJobState(JobState.FINISHED);
    }
  }
 catch (  RuntimeException e) {
    LOGGER.warn("String_Node_Str",jobId,e);
    saltJobRunner.setJobState(JobState.AMBIGUOUS);
  }
}

Fixed version (ground truth):
private void checkJobFinishedWithSuccess(){
  String jobId=saltJobRunner.getJid().getJobId();
  try {
    Multimap<String,String> missingNodesWithReason=SaltStates.jidInfo(saltConnector,jobId,new Compound(saltJobRunner.getTarget()),saltJobRunner.stateType());
    if (!missingNodesWithReason.isEmpty()) {
      LOGGER.info("String_Node_Str",jobId,String.join("String_Node_Str",missingNodesWithReason.keySet()));
      saltJobRunner.setJobState(JobState.FAILED);
      Set<String> newTargets=missingNodesWithReason.keySet().stream().map(node -> SaltStates.resolveHostNameToMinionHostName(saltConnector,node)).collect(Collectors.toSet());
      saltJobRunner.setNodesWithError(missingNodesWithReason);
      saltJobRunner.setTarget(newTargets);
    }
 else {
      LOGGER.info("String_Node_Str",jobId);
      saltJobRunner.setJobState(JobState.FINISHED);
    }
  }
 catch (  RuntimeException e) {
    LOGGER.warn("String_Node_Str",jobId,e);
    saltJobRunner.setJobState(JobState.AMBIGUOUS);
  }
}
Program: 63904
Project: 63904
Buggy source:
private String buildErrorMessage(){
  String jobId=saltJobRunner.getJid().getJobId();
  StringBuilder errorMessageBuilder=new StringBuilder();
  errorMessageBuilder.append(String.format("String_Node_Str",jobId,saltJobRunner.getTarget()));
  if (saltJobRunner.getJobState().getNodesWithError() != null) {
    for (    String host : saltJobRunner.getJobState().getNodesWithError().keySet()) {
      Collection<String> errorMessages=saltJobRunner.getJobState().getNodesWithError().get(host);
      errorMessageBuilder.append("String_Node_Str").append("String_Node_Str").append(host).append("String_Node_Str").append(String.join("String_Node_Str",errorMessages));
    }
  }
  return errorMessageBuilder.toString();
}

Fixed version (ground truth):
private String buildErrorMessage(){
  String jobId=saltJobRunner.getJid().getJobId();
  StringBuilder errorMessageBuilder=new StringBuilder();
  errorMessageBuilder.append(String.format("String_Node_Str",jobId,saltJobRunner.getTarget()));
  if (saltJobRunner.getNodesWithError() != null) {
    for (    String host : saltJobRunner.getNodesWithError().keySet()) {
      Collection<String> errorMessages=saltJobRunner.getNodesWithError().get(host);
      errorMessageBuilder.append("String_Node_Str").append("String_Node_Str").append(host).append("String_Node_Str").append(String.join("String_Node_Str",errorMessages));
    }
  }
  return errorMessageBuilder.toString();
}
Program: 63906
Project: 63906
Buggy source:
private void checkJobFinishedWithSuccess(){
  String jobId=saltJobRunner.getJid().getJobId();
  try {
    Multimap<String,String> missingNodesWithReason=SaltStates.jidInfo(saltConnector,jobId,new Compound(saltJobRunner.getTarget()),saltJobRunner.stateType());
    if (!missingNodesWithReason.isEmpty()) {
      LOGGER.info("String_Node_Str",jobId,String.join("String_Node_Str",missingNodesWithReason.keySet()));
      JobState jobState=JobState.FAILED;
      jobState.setNodesWithError(missingNodesWithReason);
      saltJobRunner.setJobState(JobState.FAILED);
      saltJobRunner.setTarget(missingNodesWithReason.keySet());
    }
 else {
      LOGGER.info("String_Node_Str",jobId);
      saltJobRunner.setJobState(JobState.FINISHED);
    }
  }
 catch (  RuntimeException e) {
    LOGGER.warn("String_Node_Str",jobId,e);
    saltJobRunner.setJobState(JobState.AMBIGUOUS);
  }
}

Fixed version (ground truth):
private void checkJobFinishedWithSuccess(){
  String jobId=saltJobRunner.getJid().getJobId();
  try {
    Multimap<String,String> missingNodesWithReason=SaltStates.jidInfo(saltConnector,jobId,new Compound(saltJobRunner.getTarget()),saltJobRunner.stateType());
    if (!missingNodesWithReason.isEmpty()) {
      LOGGER.info("String_Node_Str",jobId,String.join("String_Node_Str",missingNodesWithReason.keySet()));
      saltJobRunner.setJobState(JobState.FAILED);
      saltJobRunner.setNodesWithError(missingNodesWithReason);
      saltJobRunner.setTarget(missingNodesWithReason.keySet());
    }
 else {
      LOGGER.info("String_Node_Str",jobId);
      saltJobRunner.setJobState(JobState.FINISHED);
    }
  }
 catch (  RuntimeException e) {
    LOGGER.warn("String_Node_Str",jobId,e);
    saltJobRunner.setJobState(JobState.AMBIGUOUS);
  }
}
Program: 63907
Project: 63907
Buggy source:
private String buildErrorMessage(){
  String jobId=saltJobRunner.getJid().getJobId();
  StringBuilder errorMessageBuilder=new StringBuilder();
  errorMessageBuilder.append(String.format("String_Node_Str",jobId,saltJobRunner.getTarget()));
  if (saltJobRunner.getJobState().getNodesWithError() != null) {
    for (    String host : saltJobRunner.getJobState().getNodesWithError().keySet()) {
      Collection<String> errorMessages=saltJobRunner.getJobState().getNodesWithError().get(host);
      errorMessageBuilder.append("String_Node_Str").append("String_Node_Str").append(host).append("String_Node_Str").append(String.join("String_Node_Str",errorMessages));
    }
  }
  return errorMessageBuilder.toString();
}

Fixed version (ground truth):
private String buildErrorMessage(){
  String jobId=saltJobRunner.getJid().getJobId();
  StringBuilder errorMessageBuilder=new StringBuilder();
  errorMessageBuilder.append(String.format("String_Node_Str",jobId,saltJobRunner.getTarget()));
  if (saltJobRunner.getNodesWithError() != null) {
    for (    String host : saltJobRunner.getNodesWithError().keySet()) {
      Collection<String> errorMessages=saltJobRunner.getNodesWithError().get(host);
      errorMessageBuilder.append("String_Node_Str").append("String_Node_Str").append(host).append("String_Node_Str").append(String.join("String_Node_Str",errorMessages));
    }
  }
  return errorMessageBuilder.toString();
}
Program: 63909
Project: 63909
Buggy source:
@CliCommand(value="String_Node_Str",help="String_Node_Str") public String sync(){
  try {
    UpdateStackJson updateStackJson=new UpdateStackJson();
    updateStackJson.setStatus(StatusRequest.SYNC);
    shellContext.cloudbreakClient().stackEndpoint().put(Long.valueOf(shellContext.getStackId()),updateStackJson);
    return "String_Node_Str";
  }
 catch (  Exception ex) {
    throw shellContext.exceptionTransformer().transformToRuntimeException(ex);
  }
}

Fixed version (ground truth):
@CliCommand(value="String_Node_Str",help="String_Node_Str") public String sync(){
  try {
    UpdateStackJson updateStackJson=new UpdateStackJson();
    updateStackJson.setStatus(StatusRequest.SYNC);
    cloudbreakShellUtil.checkResponse("String_Node_Str",shellContext.cloudbreakClient().stackEndpoint().put(Long.valueOf(shellContext.getStackId()),updateStackJson));
    return "String_Node_Str";
  }
 catch (  Exception ex) {
    throw shellContext.exceptionTransformer().transformToRuntimeException(ex);
  }
}
Program: 63910
Project: 63910
Buggy source:
@CliCommand(value="String_Node_Str",help="String_Node_Str") public String sync(){
  try {
    UpdateClusterJson updateClusterJson=new UpdateClusterJson();
    updateClusterJson.setStatus(StatusRequest.SYNC);
    shellContext.cloudbreakClient().clusterEndpoint().put(Long.valueOf(shellContext.getStackId()),updateClusterJson);
    return "String_Node_Str";
  }
 catch (  Exception ex) {
    throw shellContext.exceptionTransformer().transformToRuntimeException(ex);
  }
}

Fixed version (ground truth):
@CliCommand(value="String_Node_Str",help="String_Node_Str") public String sync(){
  try {
    UpdateClusterJson updateClusterJson=new UpdateClusterJson();
    updateClusterJson.setStatus(StatusRequest.SYNC);
    cloudbreakShellUtil.checkResponse("String_Node_Str",shellContext.cloudbreakClient().clusterEndpoint().put(Long.valueOf(shellContext.getStackId()),updateClusterJson));
    return "String_Node_Str";
  }
 catch (  Exception ex) {
    throw shellContext.exceptionTransformer().transformToRuntimeException(ex);
  }
}
Program: 63911
Project: 63911
Buggy source:
@Override public BlueprintResponse convert(Blueprint entity){
  BlueprintResponse blueprintJson=new BlueprintResponse();
  blueprintJson.setId(String.valueOf(entity.getId()));
  blueprintJson.setBlueprintName(entity.getBlueprintName());
  blueprintJson.setName(entity.getName());
  blueprintJson.setPublicInAccount(entity.isPublicInAccount());
  blueprintJson.setDescription(entity.getDescription() == null ? "String_Node_Str" : entity.getDescription());
  blueprintJson.setHostGroupCount(entity.getHostGroupCount());
  blueprintJson.setStatus(entity.getStatus());
  blueprintJson.setInputs(convertNodes(entity.getInputs()));
  try {
    blueprintJson.setAmbariBlueprint(jsonHelper.createJsonFromString(entity.getBlueprintText()));
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    blueprintJson.setAmbariBlueprint(new TextNode(e.getMessage()));
  }
  return blueprintJson;
}

Fixed version (ground truth):
@Override public BlueprintResponse convert(Blueprint entity){
  BlueprintResponse blueprintJson=new BlueprintResponse();
  blueprintJson.setId(String.valueOf(entity.getId()));
  blueprintJson.setBlueprintName(entity.getBlueprintName());
  blueprintJson.setName(entity.getName());
  blueprintJson.setPublicInAccount(entity.isPublicInAccount());
  blueprintJson.setDescription(entity.getDescription() == null ? "String_Node_Str" : entity.getDescription());
  blueprintJson.setHostGroupCount(entity.getHostGroupCount());
  blueprintJson.setStatus(entity.getStatus());
  try {
    blueprintJson.setInputs(convertInputParameters(entity.getInputParameters()));
  }
 catch (  IOException e) {
    LOGGER.error(String.format("String_Node_Str",entity.getName(),entity.getId()),e);
  }
  try {
    blueprintJson.setAmbariBlueprint(jsonHelper.createJsonFromString(entity.getBlueprintText()));
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    blueprintJson.setAmbariBlueprint(new TextNode(e.getMessage()));
  }
  return blueprintJson;
}
Program: 63912
Project: 63912
Buggy source:
@PostConstruct public void updateDefaultBlueprints(){
  Iterable<Blueprint> allBlueprint=blueprintRepository.findAll();
  for (  String blueprintStrings : blueprintArray) {
    String[] split=blueprintStrings.split("String_Node_Str");
    if (!blueprintStrings.isEmpty() && (split.length == 2 || split.length == 1) && !split[0].isEmpty()) {
      try {
        String bpDefaultText=blueprintUtils.readDefaultBlueprintFromFile(split);
        LOGGER.info("String_Node_Str",split[0]);
        for (        Blueprint blueprint : allBlueprint) {
          if (blueprint.getName().equals(split[0]) && blueprint.getStatus().equals(ResourceStatus.DEFAULT)) {
            LOGGER.info("String_Node_Str",blueprint.getId(),blueprint.getName());
            JsonNode jsonNode=blueprintUtils.convertStringToJsonNode(bpDefaultText);
            JsonNode blueprintText=jsonNode.get("String_Node_Str");
            JsonNode inputs=jsonNode.get("String_Node_Str");
            blueprint.setInputs(prepareInputs(inputs));
            blueprint.setBlueprintText(blueprintText.toString());
            blueprint.setHostGroupCount(blueprintUtils.countHostGroups(blueprintText));
            blueprint.setBlueprintName(blueprintUtils.getBlueprintName(blueprintText));
            blueprintRepository.save(blueprint);
          }
        }
      }
 catch (      IOException e) {
        LOGGER.info("String_Node_Str",split[0],e);
      }
    }
  }
}

Fixed version (ground truth):
@PostConstruct public void updateDefaultBlueprints(){
  Iterable<Blueprint> allBlueprint=blueprintRepository.findAll();
  for (  String blueprintStrings : blueprintArray) {
    String[] split=blueprintStrings.split("String_Node_Str");
    if (!blueprintStrings.isEmpty() && (split.length == 2 || split.length == 1) && !split[0].isEmpty()) {
      try {
        String bpDefaultText=blueprintUtils.readDefaultBlueprintFromFile(split);
        LOGGER.info("String_Node_Str",split[0]);
        for (        Blueprint blueprint : allBlueprint) {
          if (blueprint.getName().equals(split[0]) && blueprint.getStatus().equals(ResourceStatus.DEFAULT)) {
            LOGGER.info("String_Node_Str",blueprint.getId(),blueprint.getName());
            JsonNode jsonNode=blueprintUtils.convertStringToJsonNode(bpDefaultText);
            JsonNode blueprintText=jsonNode.get("String_Node_Str");
            JsonNode inputs=jsonNode.get("String_Node_Str");
            BlueprintInputParameters inputParameters=new BlueprintInputParameters(prepareInputs(inputs));
            blueprint.setInputParameters(new Json(inputParameters));
            blueprint.setBlueprintText(blueprintText.toString());
            blueprint.setHostGroupCount(blueprintUtils.countHostGroups(blueprintText));
            blueprint.setBlueprintName(blueprintUtils.getBlueprintName(blueprintText));
            blueprintRepository.save(blueprint);
          }
        }
      }
 catch (      IOException e) {
        LOGGER.info("String_Node_Str",split[0],e);
      }
    }
  }
}
Program: 63913
Project: 63913
Buggy source:
private Set<BlueprintParameter> prepareInputs(JsonNode inputs) throws com.fasterxml.jackson.core.JsonProcessingException {
  Set<BlueprintParameter> blueprintParameters=new HashSet<>();
  if (inputs.isArray()) {
    for (    final JsonNode objNode : inputs) {
      BlueprintParameter blueprintParameter=JsonUtil.treeToValue(objNode,BlueprintParameter.class);
      blueprintParameters.add(blueprintParameter);
    }
  }
  return blueprintParameters;
}

Fixed version (ground truth):
private List<BlueprintParameter> prepareInputs(JsonNode inputs) throws com.fasterxml.jackson.core.JsonProcessingException {
  Set<BlueprintParameter> blueprintParameters=new HashSet<>();
  if (inputs.isArray()) {
    for (    final JsonNode objNode : inputs) {
      BlueprintParameter blueprintParameter=JsonUtil.treeToValue(objNode,BlueprintParameter.class);
      blueprintParameters.add(blueprintParameter);
    }
  }
  return blueprintParameters.stream().collect(Collectors.toList());
}
Program: 63914
Project: 63914
Buggy source:
public Set<Blueprint> loadBlueprints(CbUser user){
  Set<Blueprint> blueprints=new HashSet<>();
  Set<String> blueprintNames=getDefaultBlueprintNames(user);
  for (  String blueprintStrings : blueprintArray) {
    String[] split=blueprintStrings.split("String_Node_Str");
    if (!blueprintStrings.isEmpty() && (split.length == 2 || split.length == 1) && !blueprintNames.contains(blueprintStrings)&& !split[0].isEmpty()) {
      LOGGER.info("String_Node_Str",blueprintStrings,user.getUsername());
      try {
        BlueprintRequest blueprintJson=new BlueprintRequest();
        blueprintJson.setName(split[0]);
        blueprintJson.setDescription(split[0]);
        JsonNode jsonNode=blueprintUtils.convertStringToJsonNode(blueprintUtils.readDefaultBlueprintFromFile(split));
        blueprintJson.setAmbariBlueprint(blueprintUtils.convertStringToJsonNode(jsonNode.get("String_Node_Str").toString()));
        Blueprint bp=conversionService.convert(blueprintJson,Blueprint.class);
        JsonNode inputs=jsonNode.get("String_Node_Str");
        bp.setInputs(prepareInputs(inputs));
        bp.setOwner(user.getUserId());
        bp.setAccount(user.getAccount());
        bp.setPublicInAccount(true);
        bp.setStatus(ResourceStatus.DEFAULT);
        blueprintRepository.save(bp);
        blueprints.add(bp);
      }
 catch (      Exception e) {
        LOGGER.error("String_Node_Str",e,user);
      }
    }
  }
  return blueprints;
}

Fixed version (ground truth):
public Set<Blueprint> loadBlueprints(CbUser user){
  Set<Blueprint> blueprints=new HashSet<>();
  Set<String> blueprintNames=getDefaultBlueprintNames(user);
  for (  String blueprintStrings : blueprintArray) {
    String[] split=blueprintStrings.split("String_Node_Str");
    if (!blueprintStrings.isEmpty() && (split.length == 2 || split.length == 1) && !blueprintNames.contains(blueprintStrings)&& !split[0].isEmpty()) {
      LOGGER.info("String_Node_Str",blueprintStrings,user.getUsername());
      try {
        BlueprintRequest blueprintJson=new BlueprintRequest();
        blueprintJson.setName(split[0]);
        blueprintJson.setDescription(split[0]);
        JsonNode jsonNode=blueprintUtils.convertStringToJsonNode(blueprintUtils.readDefaultBlueprintFromFile(split));
        blueprintJson.setAmbariBlueprint(blueprintUtils.convertStringToJsonNode(jsonNode.get("String_Node_Str").toString()));
        Blueprint bp=conversionService.convert(blueprintJson,Blueprint.class);
        JsonNode inputs=jsonNode.get("String_Node_Str");
        BlueprintInputParameters inputParameters=new BlueprintInputParameters(prepareInputs(inputs));
        bp.setInputParameters(new Json(inputParameters));
        bp.setOwner(user.getUserId());
        bp.setAccount(user.getAccount());
        bp.setPublicInAccount(true);
        bp.setStatus(ResourceStatus.DEFAULT);
        blueprintRepository.save(bp);
        blueprints.add(bp);
      }
 catch (      Exception e) {
        LOGGER.error("String_Node_Str",e,user);
      }
    }
  }
  return blueprints;
}
Program: 63915
Project: 63915
Buggy source:
protected MachineConfiguration<S,E> getStateMachineConfiguration(){
  StateMachineConfigurationBuilder<S,E> configurationBuilder=new StateMachineConfigurationBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR,true);
  StateMachineStateBuilder<S,E> stateBuilder=new StateMachineStateBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR,true);
  StateMachineTransitionBuilder<S,E> transitionBuilder=new StateMachineTransitionBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR,true);
  StateMachineListener<S,E> listener=new StateMachineListenerAdapter<S,E>(){
    @Override public void stateChanged(    State<S,E> from,    State<S,E> to){
      LOGGER.info("String_Node_Str",getClass().getSimpleName(),from,to);
    }
    @Override public void eventNotAccepted(    Message<E> event){
      LOGGER.error("String_Node_Str",getClass().getSimpleName(),event.getClass().getSimpleName());
    }
  }
;
  return new MachineConfiguration<>(configurationBuilder,stateBuilder,transitionBuilder,listener,new SyncTaskExecutor());
}

Fixed version (ground truth):
protected MachineConfiguration<S,E> getStateMachineConfiguration(){
  StateMachineConfigurationBuilder<S,E> configurationBuilder=new StateMachineConfigurationBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR,true);
  StateMachineStateBuilder<S,E> stateBuilder=new StateMachineStateBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR,true);
  StateMachineTransitionBuilder<S,E> transitionBuilder=new StateMachineTransitionBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR,true);
  StateMachineListener<S,E> listener=new StateMachineListenerAdapter<S,E>(){
    @Override public void stateChanged(    State<S,E> from,    State<S,E> to){
      LOGGER.info("String_Node_Str",getClass().getSimpleName(),from,to);
    }
    @Override public void eventNotAccepted(    Message<E> event){
      LOGGER.error("String_Node_Str",getClass().getSimpleName(),event);
    }
  }
;
  return new MachineConfiguration<>(configurationBuilder,stateBuilder,transitionBuilder,listener,new SyncTaskExecutor());
}
Program: 63916
Project: 63916
Buggy source:
@Override public void eventNotAccepted(Message<E> event){
  LOGGER.error("String_Node_Str",getClass().getSimpleName(),event.getClass().getSimpleName());
}

Fixed version (ground truth):
@Override public void eventNotAccepted(Message<E> event){
  LOGGER.error("String_Node_Str",getClass().getSimpleName(),event);
}
Program: 63917
Project: 63917
Buggy source:
protected MachineConfiguration<S,E> getStateMachineConfiguration(){
  StateMachineConfigurationBuilder<S,E> configurationBuilder=new StateMachineConfigurationBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR,true);
  StateMachineStateBuilder<S,E> stateBuilder=new StateMachineStateBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR,true);
  StateMachineTransitionBuilder<S,E> transitionBuilder=new StateMachineTransitionBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR,true);
  StateMachineListener<S,E> listener=new StateMachineListenerAdapter<S,E>(){
    @Override public void stateChanged(    State<S,E> from,    State<S,E> to){
      LOGGER.info("String_Node_Str",getClass().getSimpleName(),from,to);
    }
    @Override public void eventNotAccepted(    Message<E> event){
      LOGGER.error("String_Node_Str",getClass().getSimpleName(),event.getClass().getSimpleName());
    }
  }
;
  return new MachineConfiguration<>(configurationBuilder,stateBuilder,transitionBuilder,listener,new SyncTaskExecutor());
}

Fixed version (ground truth):
protected MachineConfiguration<S,E> getStateMachineConfiguration(){
  StateMachineConfigurationBuilder<S,E> configurationBuilder=new StateMachineConfigurationBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR,true);
  StateMachineStateBuilder<S,E> stateBuilder=new StateMachineStateBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR,true);
  StateMachineTransitionBuilder<S,E> transitionBuilder=new StateMachineTransitionBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR,true);
  StateMachineListener<S,E> listener=new StateMachineListenerAdapter<S,E>(){
    @Override public void stateChanged(    State<S,E> from,    State<S,E> to){
      LOGGER.info("String_Node_Str",getClass().getSimpleName(),from,to);
    }
    @Override public void eventNotAccepted(    Message<E> event){
      LOGGER.error("String_Node_Str",getClass().getSimpleName(),event);
    }
  }
;
  return new MachineConfiguration<>(configurationBuilder,stateBuilder,transitionBuilder,listener,new SyncTaskExecutor());
}
Program: 63918
Project: 63918
Buggy source:
@Override public void eventNotAccepted(Message<E> event){
  LOGGER.error("String_Node_Str",getClass().getSimpleName(),event.getClass().getSimpleName());
}

Fixed version (ground truth):
@Override public void eventNotAccepted(Message<E> event){
  LOGGER.error("String_Node_Str",getClass().getSimpleName(),event);
}
Program: 63923
Project: 63923
Buggy source:
@Override public FlowFailureEvent convert(Object payload){
  return new FlowFailureEvent(((CloudPlatformResult)payload).getRequest().getCloudContext().getId(),((CloudPlatformResult)payload).getErrorDetails());
}

Fixed version (ground truth):
@Override public FlowFailureEvent convert(Object payload){
  CloudPlatformResult cloudPlatformResult=(CloudPlatformResult)payload;
  return new FlowFailureEvent(cloudPlatformResult.getRequest().getCloudContext().getId(),cloudPlatformResult.getErrorDetails());
}
Program: 63924
Project: 63924
Buggy source:
@Override protected void doExecute(StackContext context,FlowFailureEvent payload,Map<Object,Object> variables){
  stackCreationService.handeStackCreationFailure(context,payload.getException());
  sendEvent(context.getFlowId(),StackCreationEvent.STACK_CREATION_FAILED_EVENT.stringRepresentation(),payload);
}

Fixed version (ground truth):
@Override protected void doExecute(StackContext context,FlowFailureEvent payload,Map<Object,Object> variables){
  stackCreationService.handleStackCreationFailure(context,payload.getException());
  sendEvent(context.getFlowId(),StackCreationEvent.STACK_CREATION_FAILED_EVENT.stringRepresentation(),payload);
}
Program: 63925
Project: 63925
Buggy source:
@CliAvailabilityIndicator({"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) public boolean isTemplateEc2CreateCommandAvailable(){
  return true;
}

Fixed version (ground truth):
@CliAvailabilityIndicator({"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) public boolean isTemplateEc2CreateCommandAvailable(){
  return true;
}
Program: 63927
Project: 63927
Buggy source:
private void scaleUp(int scalingAdjustment,int totalNodes){
  String hostGroup=policy.getHostGroup();
  String ambari=cluster.getHost();
  AmbariAddressJson ambariAddressJson=new AmbariAddressJson();
  ambariAddressJson.setAmbariAddress(ambari);
  try {
    LOGGER.info("String_Node_Str",scalingAdjustment);
    Long stackId=cloudbreakService.stackEndpoint().getStackForAmbari(ambariAddressJson).getId();
    UpdateStackJson updateStackJson=new UpdateStackJson();
    InstanceGroupAdjustmentJson instanceGroupAdjustmentJson=new InstanceGroupAdjustmentJson();
    instanceGroupAdjustmentJson.setWithClusterEvent(true);
    instanceGroupAdjustmentJson.setScalingAdjustment(scalingAdjustment);
    instanceGroupAdjustmentJson.setInstanceGroup(hostGroup);
    updateStackJson.setInstanceGroupAdjustment(instanceGroupAdjustmentJson);
    cloudbreakService.stackEndpoint().put(stackId,updateStackJson);
    historyService.createEntry(ScalingStatus.SUCCESS,"String_Node_Str",totalNodes,policy);
  }
 catch (  Exception e) {
    historyService.createEntry(ScalingStatus.FAILED,"String_Node_Str" + e.getMessage(),totalNodes,policy);
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void scaleUp(int scalingAdjustment,int totalNodes){
  String hostGroup=policy.getHostGroup();
  String ambari=cluster.getHost();
  AmbariAddressJson ambariAddressJson=new AmbariAddressJson();
  ambariAddressJson.setAmbariAddress(ambari);
  try {
    LOGGER.info("String_Node_Str",scalingAdjustment);
    Long stackId=cloudbreakClient.stackEndpoint().getStackForAmbari(ambariAddressJson).getId();
    UpdateStackJson updateStackJson=new UpdateStackJson();
    InstanceGroupAdjustmentJson instanceGroupAdjustmentJson=new InstanceGroupAdjustmentJson();
    instanceGroupAdjustmentJson.setWithClusterEvent(true);
    instanceGroupAdjustmentJson.setScalingAdjustment(scalingAdjustment);
    instanceGroupAdjustmentJson.setInstanceGroup(hostGroup);
    updateStackJson.setInstanceGroupAdjustment(instanceGroupAdjustmentJson);
    cloudbreakClient.stackEndpoint().put(stackId,updateStackJson);
    historyService.createEntry(ScalingStatus.SUCCESS,"String_Node_Str",totalNodes,policy);
  }
 catch (  Exception e) {
    historyService.createEntry(ScalingStatus.FAILED,"String_Node_Str" + e.getMessage(),totalNodes,policy);
    LOGGER.error("String_Node_Str",e);
  }
}