Program: 64042
Project: 64042
Buggy source:
@Override public void setupMetadata(Stack stack){
  Set<CoreInstanceMetaData> coreInstanceMetadata=new HashSet<>();
  AwsTemplate awsTemplate=(AwsTemplate)stack.getTemplate();
  AwsCredential awsCredential=(AwsCredential)stack.getCredential();
  AmazonCloudFormationClient amazonCfClient=awsStackUtil.createCloudFormationClient(awsTemplate.getRegion(),awsCredential);
  AmazonEC2Client amazonEC2Client=awsStackUtil.createEC2Client(awsTemplate.getRegion(),awsCredential);
  AmazonAutoScalingClient amazonAutoScalingClient=awsStackUtil.createAutoScalingClient(awsTemplate.getRegion(),awsCredential);
  DescribeStackResourceResult result=amazonCfClient.describeStackResource(new DescribeStackResourceRequest().withStackName(stack.getResourcesbyType(ResourceType.CLOUDFORMATION_STACK).get(0).getResourceName()).withLogicalResourceId("String_Node_Str"));
  DescribeAutoScalingGroupsResult describeAutoScalingGroupsResult=amazonAutoScalingClient.describeAutoScalingGroups(new DescribeAutoScalingGroupsRequest().withAutoScalingGroupNames(result.getStackResourceDetail().getPhysicalResourceId()));
  describeAutoScalingGroupsResult.getAutoScalingGroups().get(0).getInstances();
  List<String> instanceIds=new ArrayList<>();
  for (  Instance instance : describeAutoScalingGroupsResult.getAutoScalingGroups().get(0).getInstances()) {
    instanceIds.add(instance.getInstanceId());
  }
  DescribeInstancesRequest instancesRequest=new DescribeInstancesRequest().withInstanceIds(instanceIds);
  DescribeInstancesResult instancesResult=amazonEC2Client.describeInstances(instancesRequest);
  for (  Reservation reservation : instancesResult.getReservations()) {
    for (    com.amazonaws.services.ec2.model.Instance instance : reservation.getInstances()) {
      coreInstanceMetadata.add(new CoreInstanceMetaData(instance.getInstanceId(),instance.getPrivateIpAddress(),instance.getPublicIpAddress()));
    }
  }
  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(),coreInstanceMetadata)));
}

Fixed version (ground truth):
@Override public void setupMetadata(Stack stack){
  Set<CoreInstanceMetaData> coreInstanceMetadata=new HashSet<>();
  AwsTemplate awsTemplate=(AwsTemplate)stack.getTemplate();
  AwsCredential awsCredential=(AwsCredential)stack.getCredential();
  AmazonCloudFormationClient amazonCfClient=awsStackUtil.createCloudFormationClient(awsTemplate.getRegion(),awsCredential);
  AmazonEC2Client amazonEC2Client=awsStackUtil.createEC2Client(awsTemplate.getRegion(),awsCredential);
  AmazonAutoScalingClient amazonAutoScalingClient=awsStackUtil.createAutoScalingClient(awsTemplate.getRegion(),awsCredential);
  DescribeStackResourceResult result=amazonCfClient.describeStackResource(new DescribeStackResourceRequest().withStackName(stack.getResourcesByType(ResourceType.CLOUDFORMATION_STACK).get(0).getResourceName()).withLogicalResourceId("String_Node_Str"));
  DescribeAutoScalingGroupsResult describeAutoScalingGroupsResult=amazonAutoScalingClient.describeAutoScalingGroups(new DescribeAutoScalingGroupsRequest().withAutoScalingGroupNames(result.getStackResourceDetail().getPhysicalResourceId()));
  describeAutoScalingGroupsResult.getAutoScalingGroups().get(0).getInstances();
  List<String> instanceIds=new ArrayList<>();
  for (  Instance instance : describeAutoScalingGroupsResult.getAutoScalingGroups().get(0).getInstances()) {
    instanceIds.add(instance.getInstanceId());
  }
  DescribeInstancesRequest instancesRequest=new DescribeInstancesRequest().withInstanceIds(instanceIds);
  DescribeInstancesResult instancesResult=amazonEC2Client.describeInstances(instancesRequest);
  for (  Reservation reservation : instancesResult.getReservations()) {
    for (    com.amazonaws.services.ec2.model.Instance instance : reservation.getInstances()) {
      coreInstanceMetadata.add(new CoreInstanceMetaData(instance.getInstanceId(),instance.getPrivateIpAddress(),instance.getPublicIpAddress()));
    }
  }
  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(),coreInstanceMetadata)));
}