nus-yam/ex-repair huggingface dataset:
Program: 64052
Project: 64052
Buggy source:
@Test public void testHandleMessageWhenStatusIsFailedShouldStackCreateAlreadyFailed(){
  Map<String,String> cfMessage=createCFMessage();
  cfMessage.put(RESOURCE_STATUS,"String_Node_Str");
  stack.setStatus(Status.CREATE_FAILED);
  given(snsMessageParser.parseCFMessage(snsRequest.getMessage())).willReturn(cfMessage);
  given(stackRepository.findByCfStackId(anyString())).willReturn(stack);
  underTest.handleMessage(snsRequest);
  verify(reactor,times(0)).notify(any(ReactorConfig.class),any(Event.class));
}

Fixed version (ground truth):
@Test public void testHandleMessageWhenStatusIsFailedShouldStackCreateAlreadyFailed(){
  Map<String,String> cfMessage=createCFMessage();
  cfMessage.put(RESOURCE_STATUS,"String_Node_Str");
  stack.setStatus(Status.CREATE_FAILED);
  given(snsMessageParser.parseCFMessage(snsRequest.getMessage())).willReturn(cfMessage);
  given(stackRepository.findByStackResourceName(anyString())).willReturn(stack);
  underTest.handleMessage(snsRequest);
  verify(reactor,times(0)).notify(any(ReactorConfig.class),any(Event.class));
}
Program: 64053
Project: 64053
Buggy source:
@Test public void testHandleMessageCreationCompleteNoStack(){
  given(snsMessageParser.parseCFMessage(snsRequest.getMessage())).willReturn(createCFMessage());
  given(stackRepository.findByCfStackId(anyString())).willReturn(null);
  underTest.handleMessage(snsRequest);
  verify(reactor,times(0)).notify(any(ReactorConfig.class),any(Event.class));
}

Fixed version (ground truth):
@Test public void testHandleMessageCreationCompleteNoStack(){
  given(snsMessageParser.parseCFMessage(snsRequest.getMessage())).willReturn(createCFMessage());
  given(stackRepository.findByStackResourceName(anyString())).willReturn(null);
  underTest.handleMessage(snsRequest);
  verify(reactor,times(0)).notify(any(ReactorConfig.class),any(Event.class));
}
Program: 64054
Project: 64054
Buggy source:
@Test public void testHandleMessageWhenStatusNotFailedAndCfNotCompletedShouldStackCreateFailed(){
  Map<String,String> cfMessage=createCFMessage();
  cfMessage.put(RESOURCE_TYPE,"String_Node_Str");
  cfMessage.put(RESOURCE_STATUS,"String_Node_Str");
  stack.setStatus(Status.CREATE_IN_PROGRESS);
  given(snsMessageParser.parseCFMessage(snsRequest.getMessage())).willReturn(cfMessage);
  given(stackRepository.findByCfStackId(anyString())).willReturn(stack);
  underTest.handleMessage(snsRequest);
  verify(reactor,times(1)).notify(any(ReactorConfig.class),any(Event.class));
}

Fixed version (ground truth):
@Test public void testHandleMessageWhenStatusNotFailedAndCfNotCompletedShouldStackCreateFailed(){
  Map<String,String> cfMessage=createCFMessage();
  cfMessage.put(RESOURCE_TYPE,"String_Node_Str");
  cfMessage.put(RESOURCE_STATUS,"String_Node_Str");
  stack.setStatus(Status.CREATE_IN_PROGRESS);
  given(snsMessageParser.parseCFMessage(snsRequest.getMessage())).willReturn(cfMessage);
  given(stackRepository.findByStackResourceName(anyString())).willReturn(stack);
  underTest.handleMessage(snsRequest);
  verify(reactor,times(1)).notify(any(ReactorConfig.class),any(Event.class));
}
Program: 64055
Project: 64055
Buggy source:
@Test public void testSetupMetadataWhenExceptionOccurs(){
  given(metadataSetups.get(CloudPlatform.AZURE)).willReturn(metadataSetup);
  given(stackRepository.findById(1L)).willReturn(stack);
  doThrow(new IllegalStateException()).when(metadataSetup).setupMetadata(stack);
  underTest.setupMetadata(CloudPlatform.AZURE,1L);
  verify(reactor,times(1)).notify(any(ReactorConfig.class),any(Event.class));
}

Fixed version (ground truth):
@Test public void testSetupMetadataWhenExceptionOccurs(){
  given(metadataSetups.get(CloudPlatform.AZURE)).willReturn(metadataSetup);
  given(stackRepository.findOneWithLists(1L)).willReturn(stack);
  doThrow(new IllegalStateException()).when(metadataSetup).setupMetadata(stack);
  underTest.setupMetadata(CloudPlatform.AZURE,1L);
  verify(reactor,times(1)).notify(any(ReactorConfig.class),any(Event.class));
}
Program: 64056
Project: 64056
Buggy source:
@Before public void setUp(){
  underTest=new MetadataSetupContext();
  MockitoAnnotations.initMocks(this);
  stack=new Stack();
}

Fixed version (ground truth):
@Before public void setUp(){
  underTest=new MetadataSetupContext();
  MockitoAnnotations.initMocks(this);
  stack=new Stack();
  stack.getResources().add(new Resource(ResourceType.CLOUDFORMATION_STACK,"String_Node_Str",stack));
}
Program: 64057
Project: 64057
Buggy source:
@Test public void testSetupMetadata(){
  given(metadataSetups.get(CloudPlatform.AZURE)).willReturn(metadataSetup);
  given(stackRepository.findById(1L)).willReturn(stack);
  doNothing().when(metadataSetup).setupMetadata(stack);
  underTest.setupMetadata(CloudPlatform.AZURE,1L);
  verify(metadataSetup,times(1)).setupMetadata(stack);
  verify(reactor,times(0)).notify(any(ReactorConfig.class),any(Event.class));
}

Fixed version (ground truth):
@Test public void testSetupMetadata(){
  given(metadataSetups.get(CloudPlatform.AZURE)).willReturn(metadataSetup);
  given(stackRepository.findOneWithLists(1L)).willReturn(stack);
  doNothing().when(metadataSetup).setupMetadata(stack);
  underTest.setupMetadata(CloudPlatform.AZURE,1L);
  verify(metadataSetup,times(1)).setupMetadata(stack);
  verify(reactor,times(0)).notify(any(ReactorConfig.class),any(Event.class));
}
Program: 64058
Project: 64058
Buggy source:
@Override public void deleteStack(User user,Stack stack,Credential credential){
  LOGGER.info("String_Node_Str",stack.getId());
  AwsTemplate template=(AwsTemplate)stack.getTemplate();
  AwsCredential awsCredential=(AwsCredential)credential;
  if (stack.getResourcesbyType(ResourceType.CLOUDFORMATION_TEMPLATE_NAME).get(0).getResourceName() != null) {
    AmazonCloudFormationClient client=awsStackUtil.createCloudFormationClient(template.getRegion(),awsCredential);
    LOGGER.info("String_Node_Str",stack.getId(),stack.getResourcesbyType(ResourceType.CLOUDFORMATION_TEMPLATE_NAME).get(0).getResourceName());
    DeleteStackRequest deleteStackRequest=new DeleteStackRequest().withStackName(stack.getResourcesbyType(ResourceType.CLOUDFORMATION_TEMPLATE_NAME).get(0).getResourceName());
    client.deleteStack(deleteStackRequest);
  }
}

Fixed version (ground truth):
@Override public void deleteStack(User user,Stack stack,Credential credential){
  LOGGER.info("String_Node_Str",stack.getId());
  AwsTemplate template=(AwsTemplate)stack.getTemplate();
  AwsCredential awsCredential=(AwsCredential)credential;
  Resource resource=stack.getResourcebyType(ResourceType.CLOUDFORMATION_STACK);
  if (resource != null) {
    AmazonCloudFormationClient client=awsStackUtil.createCloudFormationClient(template.getRegion(),awsCredential);
    LOGGER.info("String_Node_Str",stack.getId(),resource.getResourceName());
    DeleteStackRequest deleteStackRequest=new DeleteStackRequest().withStackName(resource.getResourceName());
    client.deleteStack(deleteStackRequest);
  }
}
Program: 64060
Project: 64060
Buggy source:
@Override public StackDescription describeStack(User user,Stack stack,Credential credential){
  AwsTemplate awsTemplate=(AwsTemplate)stack.getTemplate();
  AwsCredential awsCredential=(AwsCredential)credential;
  DescribeStacksResult stackResult=null;
  DescribeInstancesResult instancesResult=null;
  try {
    AmazonCloudFormationClient client=awsStackUtil.createCloudFormationClient(awsTemplate.getRegion(),awsCredential);
    DescribeStacksRequest stackRequest=new DescribeStacksRequest().withStackName(stack.getResourcesbyType(ResourceType.CLOUDFORMATION_TEMPLATE_NAME).get(0).getResourceName());
    stackResult=client.describeStacks(stackRequest);
  }
 catch (  AmazonServiceException e) {
    if (CF_SERVICE_NAME.equals(e.getServiceName()) && e.getErrorMessage().equals(String.format("String_Node_Str",stack.getResourcesbyType(ResourceType.CLOUDFORMATION_TEMPLATE_NAME).get(0).getResourceName()))) {
      LOGGER.error("String_Node_Str",stack.getResourcesbyType(ResourceType.CLOUDFORMATION_TEMPLATE_NAME).get(0).getResourceName());
      stackResult=new DescribeStacksResult();
    }
 else {
      throw e;
    }
  }
  AmazonEC2Client ec2Client=awsStackUtil.createEC2Client(awsTemplate.getRegion(),awsCredential);
  DescribeInstancesRequest instancesRequest=new DescribeInstancesRequest().withFilters(new Filter().withName("String_Node_Str" + INSTANCE_TAG_NAME).withValues(stack.getResourcesbyType(ResourceType.CLOUDFORMATION_TEMPLATE_NAME).get(0).getResourceName()));
  instancesResult=ec2Client.describeInstances(instancesRequest);
  return new AwsStackDescription(stackResult,instancesResult);
}

Fixed version (ground truth):
@Override public StackDescription describeStack(User user,Stack stack,Credential credential){
  AwsTemplate awsTemplate=(AwsTemplate)stack.getTemplate();
  AwsCredential awsCredential=(AwsCredential)credential;
  DescribeStacksResult stackResult=null;
  DescribeInstancesResult instancesResult=null;
  Resource resource=stack.getResourcebyType(ResourceType.CLOUDFORMATION_STACK);
  try {
    AmazonCloudFormationClient client=awsStackUtil.createCloudFormationClient(awsTemplate.getRegion(),awsCredential);
    DescribeStacksRequest stackRequest=new DescribeStacksRequest().withStackName(resource.getResourceName());
    stackResult=client.describeStacks(stackRequest);
  }
 catch (  AmazonServiceException e) {
    if (CF_SERVICE_NAME.equals(e.getServiceName()) && e.getErrorMessage().equals(String.format("String_Node_Str",resource.getResourceName()))) {
      LOGGER.error("String_Node_Str",resource.getResourceName());
      stackResult=new DescribeStacksResult();
    }
 else {
      throw e;
    }
  }
  AmazonEC2Client ec2Client=awsStackUtil.createEC2Client(awsTemplate.getRegion(),awsCredential);
  DescribeInstancesRequest instancesRequest=new DescribeInstancesRequest().withFilters(new Filter().withName("String_Node_Str" + INSTANCE_TAG_NAME).withValues());
  instancesResult=ec2Client.describeInstances(instancesRequest);
  return new AwsStackDescription(stackResult,instancesResult);
}
Program: 64064
Project: 64064
Buggy source:
private synchronized void handleCfStackCreateComplete(Map<String,String> cfMessage){
  Stack stack=stackRepository.findByCfStackId(cfMessage.get("String_Node_Str"));
  if (stack == null) {
    LOGGER.info("String_Node_Str",cfMessage.get("String_Node_Str"));
  }
 else   if (!stack.isStackCompleted()) {
    awsNetworkConfigurator.disableSourceDestCheck(stack);
    stack=stackUpdater.updateStackCreateComplete(stack.getId());
    LOGGER.info("String_Node_Str",stack.getId());
    LOGGER.info("String_Node_Str",ReactorConfig.PROVISION_COMPLETE_EVENT,stack.getId());
    Set<Resource> resourceSet=new HashSet<>();
    resourceSet.add(new Resource(ResourceType.CLOUDFORMATION_TEMPLATE_NAME,cfMessage.get("String_Node_Str"),stack));
    reactor.notify(ReactorConfig.PROVISION_COMPLETE_EVENT,Event.wrap(new ProvisionComplete(CloudPlatform.AWS,stack.getId(),resourceSet)));
  }
}

Fixed version (ground truth):
private synchronized void handleCfStackCreateComplete(Map<String,String> cfMessage){
  Stack stack=stackRepository.findByCfStackId(cfMessage.get("String_Node_Str"));
  if (stack == null) {
    LOGGER.info("String_Node_Str",cfMessage.get("String_Node_Str"));
  }
 else   if (!stack.isStackCompleted()) {
    awsNetworkConfigurator.disableSourceDestCheck(stack);
    stack=stackUpdater.updateStackCreateComplete(stack.getId());
    LOGGER.info("String_Node_Str",stack.getId());
    LOGGER.info("String_Node_Str",ReactorConfig.PROVISION_COMPLETE_EVENT,stack.getId());
    Set<Resource> resourceSet=new HashSet<>();
    resourceSet.add(new Resource(ResourceType.CLOUDFORMATION_STACK,cfMessage.get("String_Node_Str"),stack));
    reactor.notify(ReactorConfig.PROVISION_COMPLETE_EVENT,Event.wrap(new ProvisionComplete(CloudPlatform.AWS,stack.getId(),resourceSet)));
  }
}
Program: 64065
Project: 64065
Buggy source:
public Set<Resource> getDefaultResourceSet(){
  Set<Resource> resources=new HashSet<>();
  resources.add(new Resource(ResourceType.CLOUDFORMATION_TEMPLATE_NAME,ConnectorTestUtil.CF_STACK_NAME,stack));
  return resources;
}

Fixed version (ground truth):
public Set<Resource> getDefaultResourceSet(){
  Set<Resource> resources=new HashSet<>();
  resources.add(new Resource(ResourceType.CLOUDFORMATION_STACK,ConnectorTestUtil.CF_STACK_NAME,stack));
  return resources;
}
Program: 64066
Project: 64066
Buggy source:
@Before public void setUp(){
  underTest=new AwsNetworkConfigurator();
  MockitoAnnotations.initMocks(this);
  User user=AwsConnectorTestUtil.createUser();
  AwsCredential credential=AwsConnectorTestUtil.createAwsCredential();
  AwsTemplate template=AwsConnectorTestUtil.createAwsTemplate(user);
  Set<Resource> resources=new HashSet<>();
  resources.add(new Resource(ResourceType.CLOUDFORMATION_TEMPLATE_NAME,"String_Node_Str",stack));
  stack=AwsConnectorTestUtil.createStack(user,credential,template,resources);
  dsrResult=new DescribeStackResourceResult();
  dsrResult.setStackResourceDetail(new StackResourceDetail());
  dasgResult=createAutoScaldingGroups();
  diResult=createDescribeInstanceResult();
  mockClients();
}

Fixed version (ground truth):
@Before public void setUp(){
  underTest=new AwsNetworkConfigurator();
  MockitoAnnotations.initMocks(this);
  User user=AwsConnectorTestUtil.createUser();
  AwsCredential credential=AwsConnectorTestUtil.createAwsCredential();
  AwsTemplate template=AwsConnectorTestUtil.createAwsTemplate(user);
  Set<Resource> resources=new HashSet<>();
  resources.add(new Resource(ResourceType.CLOUDFORMATION_STACK,"String_Node_Str",stack));
  stack=AwsConnectorTestUtil.createStack(user,credential,template,resources);
  dsrResult=new DescribeStackResourceResult();
  dsrResult.setStackResourceDetail(new StackResourceDetail());
  dasgResult=createAutoScaldingGroups();
  diResult=createDescribeInstanceResult();
  mockClients();
}
Program: 64067
Project: 64067
Buggy source:
@Before public void setUp(){
  underTest=new AwsProvisioner();
  MockitoAnnotations.initMocks(this);
  user=AwsConnectorTestUtil.createUser();
  credential=AwsConnectorTestUtil.createAwsCredential();
  Set<Resource> resources=new HashSet<>();
  resources.add(new Resource(ResourceType.CLOUDFORMATION_TEMPLATE_NAME,"String_Node_Str",stack));
  stack=AwsConnectorTestUtil.createStack(user,credential,AwsConnectorTestUtil.createAwsTemplate(user),resources);
}

Fixed version (ground truth):
@Before public void setUp(){
  underTest=new AwsProvisioner();
  MockitoAnnotations.initMocks(this);
  user=AwsConnectorTestUtil.createUser();
  credential=AwsConnectorTestUtil.createAwsCredential();
  Set<Resource> resources=new HashSet<>();
  resources.add(new Resource(ResourceType.CLOUDFORMATION_STACK,"String_Node_Str",stack));
  stack=AwsConnectorTestUtil.createStack(user,credential,AwsConnectorTestUtil.createAwsTemplate(user),resources);
}
Program: 64068
Project: 64068
Buggy source:
@Before public void setUp(){
  underTest=new ProvisionCompleteHandler();
  MockitoAnnotations.initMocks(this);
  resourceSet=new HashSet<>();
  resourceSet.add(new Resource(ResourceType.CLOUDFORMATION_TEMPLATE_NAME,"String_Node_Str",new Stack()));
  event=createEvent();
}

Fixed version (ground truth):
@Before public void setUp(){
  underTest=new ProvisionCompleteHandler();
  MockitoAnnotations.initMocks(this);
  resourceSet=new HashSet<>();
  resourceSet.add(new Resource(ResourceType.CLOUDFORMATION_STACK,"String_Node_Str",new Stack()));
  event=createEvent();
}
Program: 64070
Project: 64070
Buggy source:
@Override public StackDescription describeStack(User user,Stack stack,Credential credential){
  AwsTemplate awsTemplate=(AwsTemplate)stack.getTemplate();
  AwsCredential awsCredential=(AwsCredential)credential;
  DescribeStacksResult stackResult=null;
  DescribeInstancesResult instancesResult=null;
  try {
    AmazonCloudFormationClient client=awsStackUtil.createCloudFormationClient(awsTemplate.getRegion(),awsCredential);
    DescribeStacksRequest stackRequest=new DescribeStacksRequest().withStackName(stack.getCfStackName());
    stackResult=client.describeStacks(stackRequest);
  }
 catch (  AmazonServiceException e) {
    if (CF_SERVICE_NAME.equals(e.getServiceName()) && e.getErrorMessage().equals(String.format("String_Node_Str",stack.getCfStackName()))) {
      LOGGER.error("String_Node_Str",stack.getCfStackName());
      stackResult=new DescribeStacksResult();
    }
 else {
      throw e;
    }
  }
  AmazonEC2Client ec2Client=awsStackUtil.createEC2Client(awsTemplate.getRegion(),awsCredential);
  DescribeInstancesRequest instancesRequest=new DescribeInstancesRequest().withFilters(new Filter().withName("String_Node_Str" + INSTANCE_TAG_NAME).withValues(stack.getName()));
  instancesResult=ec2Client.describeInstances(instancesRequest);
  return new AwsStackDescription(stackResult,instancesResult);
}

Fixed version (ground truth):
@Override public StackDescription describeStack(User user,Stack stack,Credential credential){
  AwsTemplate awsTemplate=(AwsTemplate)stack.getTemplate();
  AwsCredential awsCredential=(AwsCredential)credential;
  DescribeStacksResult stackResult=null;
  DescribeInstancesResult instancesResult=null;
  try {
    AmazonCloudFormationClient client=awsStackUtil.createCloudFormationClient(awsTemplate.getRegion(),awsCredential);
    DescribeStacksRequest stackRequest=new DescribeStacksRequest().withStackName(stack.getCfStackName());
    stackResult=client.describeStacks(stackRequest);
  }
 catch (  AmazonServiceException e) {
    if (CF_SERVICE_NAME.equals(e.getServiceName()) && e.getErrorMessage().equals(String.format("String_Node_Str",stack.getCfStackName()))) {
      LOGGER.error("String_Node_Str",stack.getCfStackName());
      stackResult=new DescribeStacksResult();
    }
 else {
      throw e;
    }
  }
  AmazonEC2Client ec2Client=awsStackUtil.createEC2Client(awsTemplate.getRegion(),awsCredential);
  DescribeInstancesRequest instancesRequest=new DescribeInstancesRequest().withFilters(new Filter().withName("String_Node_Str" + INSTANCE_TAG_NAME).withValues(stack.getCfStackName()));
  instancesResult=ec2Client.describeInstances(instancesRequest);
  return new AwsStackDescription(stackResult,instancesResult);
}
Program: 64076
Project: 64076
Buggy source:
@Override public void setupMetadata(Stack stack){
  AzureCredential azureCredential=(AzureCredential)stack.getCredential();
  String filePath=AzureCertificateService.getUserJksFileName(azureCredential,stack.getUser().emailAsFolder());
  File file=new File(filePath);
  AzureClient azureClient=new AzureClient(azureCredential.getSubscriptionId(),file.getAbsolutePath(),azureCredential.getJks());
  String name=stack.getName().replaceAll("String_Node_Str","String_Node_Str");
  Set<CoreInstanceMetaData> instanceMetaDatas=collectMetaData(stack,azureClient,name);
  LOGGER.info("String_Node_Str",ReactorConfig.METADATA_SETUP_COMPLETE_EVENT,stack.getId());
  reactor.notify(ReactorConfig.METADATA_SETUP_COMPLETE_EVENT,Event.wrap(new MetadataSetupComplete(CloudPlatform.AWS,stack.getId(),instanceMetaDatas)));
}

Fixed version (ground truth):
@Override public void setupMetadata(Stack stack){
  AzureCredential azureCredential=(AzureCredential)stack.getCredential();
  String filePath=AzureCertificateService.getUserJksFileName(azureCredential,stack.getUser().emailAsFolder());
  File file=new File(filePath);
  AzureClient azureClient=new AzureClient(azureCredential.getSubscriptionId(),file.getAbsolutePath(),azureCredential.getJks());
  String name=stack.getName().replaceAll("String_Node_Str","String_Node_Str");
  Set<CoreInstanceMetaData> instanceMetaDatas=collectMetaData(stack,azureClient,name);
  LOGGER.info("String_Node_Str",ReactorConfig.METADATA_SETUP_COMPLETE_EVENT,stack.getId());
  reactor.notify(ReactorConfig.METADATA_SETUP_COMPLETE_EVENT,Event.wrap(new MetadataSetupComplete(CloudPlatform.AZURE,stack.getId(),instanceMetaDatas)));
}
Program: 64078
Project: 64078
Buggy source:
public String build() throws IOException {
  Validate.notNull(cloudPlatform);
  Validate.notEmpty(parameters);
  String ec2userDataScript=FileReaderUtils.readFileFromClasspath(String.format("String_Node_Str",cloudPlatform.getValue()));
  StringBuilder stringBuilder=new StringBuilder("String_Node_Str");
  stringBuilder.append("String_Node_Str").append("String_Node_Str");
  for (  Entry<String,String> parameter : parameters.entrySet()) {
    stringBuilder.append(parameter.getKey()).append("String_Node_Str").append(parameter.getValue()).append("String_Node_Str");
  }
  stringBuilder.append("String_Node_Str").append(ec2userDataScript);
  return stringBuilder.toString();
}

Fixed version (ground truth):
public String build(CloudPlatform cloudPlatform,Map<String,String> parameters){
  String ec2userDataScript=userDataScripts.get(cloudPlatform);
  StringBuilder stringBuilder=new StringBuilder("String_Node_Str");
  stringBuilder.append("String_Node_Str").append("String_Node_Str");
  for (  Entry<String,String> parameter : parameters.entrySet()) {
    stringBuilder.append(parameter.getKey()).append("String_Node_Str").append(parameter.getValue()).append("String_Node_Str");
  }
  stringBuilder.append("String_Node_Str").append(ec2userDataScript);
  return stringBuilder.toString();
}
Program: 64080
Project: 64080
Buggy source:
@Test public void testBuildUserDataEc2() throws IOException {
  String expectedScript=FileReaderUtils.readFileFromClasspath("String_Node_Str");
  String result=UserDataBuilder.builder().withCloudPlatform(CloudPlatform.AWS).withEnvironmentVariable("String_Node_Str","String_Node_Str").withEnvironmentVariable("String_Node_Str","String_Node_Str").build();
  Assert.assertEquals(expectedScript,result);
}

Fixed version (ground truth):
@Test public void testBuildUserDataEc2() throws IOException {
  String expectedScript=FileReaderUtils.readFileFromClasspath("String_Node_Str");
  Map<String,String> map=new HashMap<>();
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  Assert.assertEquals(expectedScript,userDataBuilder.build(CloudPlatform.AWS,map));
}
Program: 64081
Project: 64081
Buggy source:
@Test public void testBuildUserDataAzure() throws IOException {
  String expectedScript=FileReaderUtils.readFileFromClasspath("String_Node_Str");
  String result=UserDataBuilder.builder().withCloudPlatform(CloudPlatform.AZURE).withEnvironmentVariable("String_Node_Str","String_Node_Str").withEnvironmentVariable("String_Node_Str","String_Node_Str").build();
  Assert.assertEquals(expectedScript,result);
}

Fixed version (ground truth):
@Test public void testBuildUserDataAzure() throws IOException {
  String expectedScript=FileReaderUtils.readFileFromClasspath("String_Node_Str");
  Map<String,String> map=new HashMap<>();
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  Assert.assertEquals(expectedScript,userDataBuilder.build(CloudPlatform.AZURE,map));
}
Program: 64083
Project: 64083
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") @ResponseBody public ModelAndView getJksFile(@CurrentUser User user,@PathVariable Long credentialId,HttpServletResponse response) throws Exception {
  File cerFile=azureCredentialService.getCertificateFile(credentialId,user);
  response.setContentType("String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str" + user.emailAsFolder() + "String_Node_Str");
  FileCopyUtils.copy(Files.readAllBytes(cerFile.toPath()),response.getOutputStream());
  return null;
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") @ResponseBody public ModelAndView getJksFile(@CurrentUser User user,@PathVariable Long credentialId,HttpServletResponse response) throws Exception {
  File cerFile=azureCertificateService.getCertificateFile(credentialId,user);
  response.setContentType("String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str" + user.emailAsFolder() + "String_Node_Str");
  FileCopyUtils.copy(Files.readAllBytes(cerFile.toPath()),response.getOutputStream());
  return null;
}
Program: 64084
Project: 64084
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") @ResponseBody public ResponseEntity<Set<MetaDataJson>> getStack(@CurrentUser User user,@PathVariable String hash){
  Set<MetaDataJson> metaData=stackService.getMetaData(user,hash);
  return new ResponseEntity<>(metaData,HttpStatus.OK);
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") @ResponseBody public ResponseEntity<StackJson> getStack(@CurrentUser User user,@PathVariable Long stackId){
  StackJson stackJson=stackService.get(userRepository.findOne(user.getId()),stackId);
  return new ResponseEntity<>(stackJson,HttpStatus.OK);
}
Program: 64085
Project: 64085
Buggy source:
@JsonProperty("String_Node_Str") public Set<MetaDataJson> getMetadata(){
  return metadata;
}

Fixed version (ground truth):
@JsonProperty("String_Node_Str") public Set<InstanceMetaDataJson> getMetadata(){
  return metadata;
}
Program: 64086
Project: 64086
Buggy source:
@JsonIgnore public void setMetadata(Set<MetaDataJson> metadata){
  this.metadata=metadata;
}

Fixed version (ground truth):
@JsonIgnore public void setMetadata(Set<InstanceMetaDataJson> metadata){
  this.metadata=metadata;
}
Program: 64087
Project: 64087
Buggy source:
@Override public MetaData convert(MetaDataJson json){
  MetaData metaData=new MetaData();
  metaData.setPrivateIp(json.getPrivateIp());
  metaData.setPublicIp(json.getPublicIp());
  return metaData;
}

Fixed version (ground truth):
@Override public InstanceMetaData convert(InstanceMetaDataJson json){
  InstanceMetaData instanceMetaData=new InstanceMetaData();
  instanceMetaData.setPrivateIp(json.getPrivateIp());
  instanceMetaData.setPublicIp(json.getPublicIp());
  return instanceMetaData;
}
Program: 64088
Project: 64088
Buggy source:
private Stack doUpdateMetaData(Long stackId,Set<MetaData> metaData){
  Stack stack=stackRepository.findById(stackId);
  stack.setMetaData(metaData);
  stack=stackRepository.save(stack);
  LOGGER.info("String_Node_Str",stackId);
  return stack;
}

Fixed version (ground truth):
private Stack doUpdateMetaData(Long stackId,Set<InstanceMetaData> instanceMetaData){
  Stack stack=stackRepository.findById(stackId);
  stack.setInstanceMetaData(instanceMetaData);
  stack=stackRepository.save(stack);
  LOGGER.info("String_Node_Str",stackId);
  return stack;
}
Program: 64089
Project: 64089
Buggy source:
public Stack updateStackMetaData(Long stackId,String hash){
  int attempt=1;
  try {
    return doUpdateStackHash(stackId,hash);
  }
 catch (  OptimisticLockException|OptimisticLockingFailureException e) {
    LOGGER.info("String_Node_Str",stackId,attempt++,e.getClass().getSimpleName());
    if (attempt <= MAX_RETRIES) {
      return doUpdateStackHash(stackId,hash);
    }
 else {
      throw new InternalServerException(String.format("String_Node_Str",stackId),e);
    }
  }
}

Fixed version (ground truth):
public Stack updateStackMetaData(Long stackId,Set<InstanceMetaData> instanceMetaData){
  int attempt=1;
  try {
    return doUpdateMetaData(stackId,instanceMetaData);
  }
 catch (  OptimisticLockException|OptimisticLockingFailureException e) {
    LOGGER.info("String_Node_Str",stackId,attempt++,e.getClass().getSimpleName());
    if (attempt <= MAX_RETRIES) {
      return doUpdateMetaData(stackId,instanceMetaData);
    }
 else {
      throw new InternalServerException(String.format("String_Node_Str",stackId),e);
    }
  }
}
Program: 64090
Project: 64090
Buggy source:
private IdJson saveAzureCredential(User user,CredentialJson credentialJson){
  AzureCredential azureCredential=azureCredentialConverter.convert(credentialJson);
  azureCredential.setAzureCredentialOwner(user);
  azureCredentialRepository.save(azureCredential);
  azureCredentialService.generateCertificate(azureCredential,user);
  websocketService.sendToTopicUser(user.getEmail(),WebsocketEndPoint.CREDENTIAL,new StatusMessage(azureCredential.getId(),azureCredential.getName(),Status.CREATE_COMPLETED.name()));
  return new IdJson(azureCredential.getId());
}

Fixed version (ground truth):
private IdJson saveAzureCredential(User user,CredentialJson credentialJson){
  AzureCredential azureCredential=azureCredentialConverter.convert(credentialJson);
  azureCredential.setAzureCredentialOwner(user);
  azureCredentialRepository.save(azureCredential);
  azureCertificateService.generateCertificate(azureCredential,user);
  websocketService.sendToTopicUser(user.getEmail(),WebsocketEndPoint.CREDENTIAL,new StatusMessage(azureCredential.getId(),azureCredential.getName(),Status.CREATE_COMPLETED.name()));
  return new IdJson(azureCredential.getId());
}
Program: 64091
Project: 64091
Buggy source:
@Override public Set<MetaDataJson> getMetaData(User one,String hash){
  Stack stack=stackRepository.findStackByHash(hash);
  if (stack != null && !stack.getMetaData().isEmpty()) {
    return metaDataConverter.convertAllEntityToJson(stack.getMetaData());
  }
  throw new NotFoundException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Set<InstanceMetaDataJson> getMetaData(User one,String hash){
  Stack stack=stackRepository.findStackByHash(hash);
  if (stack != null && !stack.getInstanceMetaData().isEmpty()) {
    return metaDataConverter.convertAllEntityToJson(stack.getInstanceMetaData());
  }
  throw new NotFoundException("String_Node_Str");
}
Program: 64092
Project: 64092
Buggy source:
Set<MetaDataJson> getMetaData(User one,String hash);

Fixed version (ground truth):
Set<InstanceMetaDataJson> getMetaData(User one,String hash);
Program: 64093
Project: 64093
Buggy source:
@PostConstruct public void readUserDataScript() throws IOException {
  String ec2userDataScript=FileReaderUtils.readFileFromClasspath("String_Node_Str");
}

Fixed version (ground truth):
@PostConstruct public void readUserDataScript() throws IOException {
  ec2userDataScript=FileReaderUtils.readFileFromClasspath("String_Node_Str");
}
Program: 64095
Project: 64095
Buggy source:
@Override public boolean validate(Map<String,String> parameters,ConstraintValidatorContext context,List<TemplateParam> paramsList){
  boolean valid=true;
  for (  TemplateParam param : paramsList) {
    if (param.getRegex().isPresent()) {
      if (parameters.containsKey(param.getName())) {
        if (parameters.get(param.getName()).matches(param.getRegex().get())) {
          addParameterConstraintViolation(context,param.getName(),String.format("String_Node_Str",param.getName()));
          valid=false;
        }
      }
 else {
        valid=false;
      }
    }
  }
  return valid;
}

Fixed version (ground truth):
@Override public boolean validate(Map<String,String> parameters,ConstraintValidatorContext context,List<TemplateParam> paramsList){
  boolean valid=true;
  for (  TemplateParam param : paramsList) {
    if (param.getRegex().isPresent()) {
      if (parameters.containsKey(param.getName())) {
        if (!parameters.get(param.getName()).matches(param.getRegex().get())) {
          addParameterConstraintViolation(context,param.getName(),String.format("String_Node_Str",param.getName(),param.getRegex().get()));
          valid=false;
        }
      }
    }
  }
  return valid;
}
Program: 64096
Project: 64096
Buggy source:
@Override public AzureTemplate convert(TemplateJson json){
  AzureTemplate azureTemplate=new AzureTemplate();
  azureTemplate.setName(json.getClusterName());
  azureTemplate.setDeploymentSlot(json.getParameters().get(RequiredAzureTemplateParam.DEPLOYMENTSLOT.getName()));
  azureTemplate.setDescription(json.getParameters().get(RequiredAzureTemplateParam.DESCRIPTION.getName()));
  azureTemplate.setImageName(json.getParameters().get(RequiredAzureTemplateParam.IMAGENAME.getName()));
  azureTemplate.setLocation(json.getParameters().get(RequiredAzureTemplateParam.LOCATION.getName()));
  azureTemplate.setName(json.getClusterName());
  azureTemplate.setPassword(json.getParameters().get(RequiredAzureTemplateParam.PASSWORD.getName()));
  azureTemplate.setSshPublicKeyFingerprint(json.getParameters().get(RequiredAzureTemplateParam.SSH_PUBLIC_KEY_FINGERPRINT.getName()));
  azureTemplate.setSshPublicKeyPath(json.getParameters().get(RequiredAzureTemplateParam.SSH_PUBLIC_KEY_PATH.getName()));
  azureTemplate.setSubnetAddressPrefix(json.getParameters().get(RequiredAzureTemplateParam.ADDRESSPREFIX.getName()));
  azureTemplate.setUserName(json.getParameters().get(RequiredAzureTemplateParam.USERNAME.getName()));
  azureTemplate.setVmType(json.getParameters().get(RequiredAzureTemplateParam.VMTYPE.getName()));
  return azureTemplate;
}

Fixed version (ground truth):
@Override public AzureTemplate convert(TemplateJson json){
  AzureTemplate azureTemplate=new AzureTemplate();
  azureTemplate.setName(json.getClusterName());
  azureTemplate.setDeploymentSlot(json.getParameters().get(RequiredAzureTemplateParam.DEPLOYMENTSLOT.getName()));
  azureTemplate.setDescription(json.getParameters().get(RequiredAzureTemplateParam.DESCRIPTION.getName()));
  azureTemplate.setImageName(json.getParameters().get(RequiredAzureTemplateParam.IMAGENAME.getName()));
  azureTemplate.setLocation(json.getParameters().get(RequiredAzureTemplateParam.LOCATION.getName()));
  azureTemplate.setName(json.getClusterName());
  azureTemplate.setPassword(json.getParameters().get(RequiredAzureTemplateParam.PASSWORD.getName()));
  azureTemplate.setSshPublicKeyFingerprint(json.getParameters().get(RequiredAzureTemplateParam.SSH_PUBLIC_KEY_FINGERPRINT.getName()));
  azureTemplate.setSshPublicKeyPath(json.getParameters().get(RequiredAzureTemplateParam.SSH_PUBLIC_KEY_PATH.getName()));
  azureTemplate.setSubnetAddressPrefix(json.getParameters().get(RequiredAzureTemplateParam.ADDRESSPREFIX.getName()));
  azureTemplate.setUserName(json.getParameters().get(RequiredAzureTemplateParam.USERNAME.getName()));
  azureTemplate.setVmType(json.getParameters().get(RequiredAzureTemplateParam.VMTYPE.getName()));
  azureTemplate.setSubnetAddressPrefix(json.getParameters().get(RequiredAzureTemplateParam.SUBNETADDRESSPREFIX.getName()));
  return azureTemplate;
}
Program: 64098
Project: 64098
Buggy source:
@Override public boolean validate(Map<String,String> parameters,ConstraintValidatorContext context,List<TemplateParam> paramList){
  boolean valid=true;
  for (  TemplateParam param : paramList) {
    if (parameters.containsKey(param.getName())) {
      valid=validateClass(parameters,context,param);
    }
  }
  return valid;
}

Fixed version (ground truth):
@Override public boolean validate(Map<String,String> parameters,ConstraintValidatorContext context,List<TemplateParam> paramList){
  boolean valid=true;
  for (  TemplateParam param : paramList) {
    if (parameters.containsKey(param.getName())) {
      if (!validateClass(parameters,context,param)) {
        valid=false;
      }
    }
  }
  return valid;
}
Program: 64099
Project: 64099
Buggy source:
@Override public boolean validate(Map<String,String> parameters,ConstraintValidatorContext context,List<TemplateParam> paramList){
  boolean valid=true;
  for (  TemplateParam param : paramList) {
    if (!parameters.containsKey(param.getName())) {
      addParameterConstraintViolation(context,param.getName(),String.format("String_Node_Str",param.getName()));
      valid=false;
    }
 else {
      valid=validateClass(parameters,context,param);
    }
  }
  return valid;
}

Fixed version (ground truth):
@Override public boolean validate(Map<String,String> parameters,ConstraintValidatorContext context,List<TemplateParam> paramList){
  boolean valid=true;
  for (  TemplateParam param : paramList) {
    if (!parameters.containsKey(param.getName())) {
      addParameterConstraintViolation(context,param.getName(),String.format("String_Node_Str",param.getName()));
      valid=false;
    }
 else {
      if (!validateClass(parameters,context,param)) {
        valid=false;
      }
    }
  }
  return valid;
}
Program: 64100
Project: 64100
Buggy source:
@Override public void afterPropertiesSet() throws Exception {
  User user2=new User();
  user2.setEmail("String_Node_Str");
  user2.setFirstName("String_Node_Str");
  user2.setLastName("String_Node_Str");
  user2.setPassword("String_Node_Str");
  user2.setSubscriptionId("String_Node_Str");
  user2.setJks("String_Node_Str");
  AwsInfra awsInfra=new AwsInfra();
  awsInfra.setName("String_Node_Str");
  awsInfra.setKeyName("String_Node_Str");
  awsInfra.setName("String_Node_Str");
  awsInfra.setRegion("String_Node_Str");
  awsInfra.setUser(user2);
  user2.getAwsInfraList().add(awsInfra);
  userRepository.save(user2);
}

Fixed version (ground truth):
@Override public void afterPropertiesSet() throws Exception {
  User user2=new User();
  user2.setEmail("String_Node_Str");
  user2.setFirstName("String_Node_Str");
  user2.setLastName("String_Node_Str");
  user2.setPassword("String_Node_Str");
  user2.setSubscriptionId("String_Node_Str");
  user2.setJks("String_Node_Str");
  user2.setRoleArn("String_Node_Str");
  AwsInfra awsInfra=new AwsInfra();
  awsInfra.setName("String_Node_Str");
  awsInfra.setKeyName("String_Node_Str");
  awsInfra.setName("String_Node_Str");
  awsInfra.setRegion("String_Node_Str");
  awsInfra.setUser(user2);
  CloudInstance awsCloudInstance=new CloudInstance();
  awsCloudInstance.setInfra(awsInfra);
  awsCloudInstance.setClusterSize(CLUSTER_SIZE);
  awsCloudInstance.setUser(user2);
  user2.getAwsInfraList().add(awsInfra);
  user2.getCloudInstances().add(awsCloudInstance);
  AzureInfra azureInfra=new AzureInfra();
  azureInfra.setDeploymentSlot("String_Node_Str");
  azureInfra.setDescription("String_Node_Str");
  azureInfra.setDisableSshPasswordAuthentication(false);
  azureInfra.setImageName("String_Node_Str");
  azureInfra.setLocation("String_Node_Str");
  azureInfra.setName("String_Node_Str");
  azureInfra.setPassword("String_Node_Str");
  azureInfra.setSubnetAddressPrefix("String_Node_Str");
  azureInfra.setVmType("String_Node_Str");
  azureInfra.setUser(user2);
  CloudInstance azureCloudInstance=new CloudInstance();
  azureCloudInstance.setInfra(azureInfra);
  azureCloudInstance.setClusterSize(CLUSTER_SIZE);
  azureCloudInstance.setUser(user2);
  user2.getAzureInfraList().add(azureInfra);
  user2.getCloudInstances().add(azureCloudInstance);
  userRepository.save(user2);
}
Program: 64101
Project: 64101
Buggy source:
public Long getId(){
  return id;
}

Fixed version (ground truth):
@JsonProperty("String_Node_Str") public Long getId(){
  return id;
}
Program: 64102
Project: 64102
Buggy source:
@Override public void afterPropertiesSet() throws Exception {
  User user1=new User();
  user1.setEmail("String_Node_Str");
  user1.setFirstName("String_Node_Str");
  user1.setLastName("String_Node_Str");
  user1.setPassword("String_Node_Str");
  User user2=new User();
  user2.setEmail("String_Node_Str");
  user2.setFirstName("String_Node_Str");
  user2.setLastName("String_Node_Str");
  user2.setPassword("String_Node_Str");
  user2.setSubscriptionId("String_Node_Str");
  user2.setJks("String_Node_Str");
  AwsInfra awsInfra=new AwsInfra();
  awsInfra.setName("String_Node_Str");
  awsInfra.setKeyName("String_Node_Str");
  awsInfra.setName("String_Node_Str");
  awsInfra.setRegion("String_Node_Str");
  awsInfra.setUser(user2);
  user2.getAwsInfraList().add(awsInfra);
  userRepository.save(user1);
  userRepository.save(user2);
}

Fixed version (ground truth):
@Override public void afterPropertiesSet() throws Exception {
  User user2=new User();
  user2.setEmail("String_Node_Str");
  user2.setFirstName("String_Node_Str");
  user2.setLastName("String_Node_Str");
  user2.setPassword("String_Node_Str");
  user2.setSubscriptionId("String_Node_Str");
  user2.setJks("String_Node_Str");
  AwsInfra awsInfra=new AwsInfra();
  awsInfra.setName("String_Node_Str");
  awsInfra.setKeyName("String_Node_Str");
  awsInfra.setName("String_Node_Str");
  awsInfra.setRegion("String_Node_Str");
  awsInfra.setUser(user2);
  user2.getAwsInfraList().add(awsInfra);
  userRepository.save(user2);
}
Program: 64103
Project: 64103
Buggy source:
@JsonIgnore public void setCloudPlatform(CloudPlatform cloudPlatform){
  this.cloudPlatform=cloudPlatform;
}

Fixed version (ground truth):
public void setCloudPlatform(CloudPlatform cloudPlatform){
  this.cloudPlatform=cloudPlatform;
}
Program: 64104
Project: 64104
Buggy source:
@JsonProperty("String_Node_Str") public CloudPlatform getCloudPlatform(){
  return cloudPlatform;
}

Fixed version (ground truth):
public CloudPlatform getCloudPlatform(){
  return cloudPlatform;
}
Program: 64105
Project: 64105
Buggy source:
@JsonIgnore public void setCloudPlatform(CloudPlatform type){
  this.cloudPlatform=type;
}

Fixed version (ground truth):
public void setCloudPlatform(CloudPlatform type){
  this.cloudPlatform=type;
}
Program: 64106
Project: 64106
Buggy source:
@JsonProperty("String_Node_Str") public CloudPlatform getCloudPlatform(){
  return cloudPlatform;
}

Fixed version (ground truth):
public CloudPlatform getCloudPlatform(){
  return cloudPlatform;
}
Program: 64107
Project: 64107
Buggy source:
@Override public void afterPropertiesSet() throws Exception {
  User user1=new User();
  user1.setEmail("String_Node_Str");
  user1.setFirstName("String_Node_Str");
  user1.setLastName("String_Node_Str");
  user1.setPassword("String_Node_Str");
  User user2=new User();
  user2.setEmail("String_Node_Str");
  user2.setFirstName("String_Node_Str");
  user2.setLastName("String_Node_Str");
  user2.setPassword("String_Node_Str");
  user2.setSubscriptionId("String_Node_Str");
  user2.setJks("String_Node_Str");
  AzureInfra azureInfra=new AzureInfra();
  azureInfra.setName("String_Node_Str");
  user2.getAzureInfraList().add(azureInfra);
  userRepository.save(user1);
  userRepository.save(user2);
}

Fixed version (ground truth):
@Override public void afterPropertiesSet() throws Exception {
  User user1=new User();
  user1.setEmail("String_Node_Str");
  user1.setFirstName("String_Node_Str");
  user1.setLastName("String_Node_Str");
  user1.setPassword("String_Node_Str");
  User user2=new User();
  user2.setEmail("String_Node_Str");
  user2.setFirstName("String_Node_Str");
  user2.setLastName("String_Node_Str");
  user2.setPassword("String_Node_Str");
  user2.setSubscriptionId("String_Node_Str");
  user2.setJks("String_Node_Str");
  AwsInfra awsInfra=new AwsInfra();
  awsInfra.setName("String_Node_Str");
  awsInfra.setKeyName("String_Node_Str");
  awsInfra.setName("String_Node_Str");
  awsInfra.setRegion("String_Node_Str");
  user2.getAwsInfraList().add(awsInfra);
  userRepository.save(user1);
  userRepository.save(user2);
}
Program: 64108
Project: 64108
Buggy source:
@Override public AwsCloudInstance convert(CloudInstanceRequest json){
  AwsCloudInstance awsCloudInstance=new AwsCloudInstance();
  awsCloudInstance.setClusterSize(json.getClusterSize());
  awsCloudInstance.setAwsInfra(awsInfraRepository.findOne(Long.valueOf(json.getInfraId())));
  return new AwsCloudInstance();
}

Fixed version (ground truth):
@Override public AwsCloudInstance convert(CloudInstanceRequest json){
  AwsCloudInstance awsCloudInstance=new AwsCloudInstance();
  awsCloudInstance.setClusterSize(json.getClusterSize());
  awsCloudInstance.setAwsInfra(awsInfraRepository.findOne(Long.valueOf(json.getInfraId())));
  return awsCloudInstance;
}
Program: 64109
Project: 64109
Buggy source:
public CloudInstanceRequest get(Long id){
  AwsCloudInstance awsInstance=awsCloudInstanceRepository.findOne(id);
  if (awsInstance == null) {
    AzureCloudInstance azureInstance=azureCloudInstanceRepository.findOne(id);
    if (azureInstance == null) {
      return azureCloudInstanceConverter.convert(azureInstance);
    }
 else {
      return null;
    }
  }
 else {
    return awsCloudInstanceConverter.convert(awsInstance);
  }
}

Fixed version (ground truth):
public CloudInstanceRequest get(Long id){
  AwsCloudInstance awsInstance=awsCloudInstanceRepository.findOne(id);
  if (awsInstance == null) {
    AzureCloudInstance azureInstance=azureCloudInstanceRepository.findOne(id);
    if (azureInstance == null) {
      return null;
    }
 else {
      return azureCloudInstanceConverter.convert(azureInstance);
    }
  }
 else {
    return awsCloudInstanceConverter.convert(awsInstance);
  }
}
Program: 64110
Project: 64110
Buggy source:
public InfraRequest get(Long id){
  AwsInfra awsInfra=awsInfraRepository.findOne(id);
  if (awsInfra == null) {
    AzureInfra azureInfra=azureInfraRepository.findOne(id);
    if (azureInfra == null) {
      return azureInfraConverter.convert(azureInfra);
    }
 else {
      return null;
    }
  }
 else {
    return awsInfraConverter.convert(awsInfra);
  }
}

Fixed version (ground truth):
public InfraRequest get(Long id){
  AwsInfra awsInfra=awsInfraRepository.findOne(id);
  if (awsInfra == null) {
    AzureInfra azureInfra=azureInfraRepository.findOne(id);
    if (azureInfra == null) {
      return null;
    }
 else {
      return azureInfraConverter.convert(azureInfra);
    }
  }
 else {
    return awsInfraConverter.convert(awsInfra);
  }
}
Program: 64111
Project: 64111
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") @ResponseBody public ResponseEntity<UserJson> generate(@CurrentUser User user) throws Exception {
  UserJson json=userConverter.convert(user);
  return new ResponseEntity<>(json,HttpStatus.OK);
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") @ResponseBody public ResponseEntity<UserJson> generate(@CurrentUser User user) throws Exception {
  User oneWithLists=userRepository.findOneWithLists(user.getId());
  UserJson json=userConverter.convert(user);
  return new ResponseEntity<>(json,HttpStatus.OK);
}
Program: 64112
Project: 64112
Buggy source:
@Override public boolean isValid(ProvisionRequest request,ConstraintValidatorContext context){
  boolean valid=true;
switch (request.getCloudPlatform()) {
case AWS:
    for (    String param : requiredAWSParams) {
      if (!request.getParameters().containsKey(param)) {
        addParameterConstraintViolation(context,param,String.format("String_Node_Str",param));
        valid=false;
      }
    }
  break;
case AZURE:
break;
}
return valid;
}

Fixed version (ground truth):
@Override public boolean isValid(ProvisionRequest request,ConstraintValidatorContext context){
  boolean valid=true;
switch (request.getCloudPlatform()) {
case AWS:
    for (    String param : requiredAWSParams) {
      if (!request.getParameters().containsKey(param)) {
        addParameterConstraintViolation(context,param,String.format("String_Node_Str",param));
        valid=false;
      }
    }
  break;
case AZURE:
break;
default :
break;
}
return valid;
}
Program: 64113
Project: 64113
Buggy source:
public SampleJson(String name,String status){
  super();
  this.name=name;
  this.status=status;
}

Fixed version (ground truth):
public SampleJson(String name,String status){
  this.name=name;
  this.status=status;
}
Program: 64114
Project: 64114
Buggy source:
/** 
 * Returns the name of the test
 * @return
 */
String getName();

Fixed version (ground truth):
/** 
 * @return Returns the name of the test
 */
String getName();