Program: 48351
Project: 48351
Buggy source:
@Override public Map<String,Object> call() throws Exception {
  Map<String,Object> result=new HashMap<String,Object>();
  ClusterReportQueue queue=new ClusterReportQueue();
  Thread progressThread=null;
  ExternalProgressMonitor monitor=new ExternalProgressMonitor(targetName,queue,statusUpdater,lockedClusterEntityManager);
  progressThread=new Thread(monitor,"String_Node_Str" + targetName);
  progressThread.setDaemon(true);
  progressThread.start();
  boolean success=false;
  boolean force=false;
  if (chunkContext != null) {
    force=JobUtils.getJobParameterForceClusterOperation(chunkContext);
  }
  try {
switch (managementOperation) {
case CREATE:
      success=softwareManager.createCluster(clusterBlueprint,queue);
    break;
case CONFIGURE:
  success=softwareManager.reconfigCluster(clusterBlueprint,queue);
break;
case PRE_DESTROY:
if (softwareManager == null) {
logger.warn("String_Node_Str" + clusterBlueprint.getName() + "String_Node_Str");
logger.warn("String_Node_Str");
success=true;
}
 else {
try {
  softwareManager.onDeleteCluster(clusterBlueprint,queue);
}
 catch (Exception e) {
  String errMsg="String_Node_Str" + softwareManager.getName() + "String_Node_Str";
  logger.error(errMsg,e);
}
success=true;
}
break;
case DESTROY:
success=softwareManager.deleteCluster(clusterBlueprint,queue);
break;
case START:
success=softwareManager.startCluster(clusterBlueprint,queue,force);
break;
case STOP:
success=softwareManager.onStopCluster(clusterBlueprint,queue);
break;
case START_NODES:
List<NodeInfo> nodes=new ArrayList<NodeInfo>();
for (NodeGroupInfo group : clusterBlueprint.getNodeGroups()) {
if (group != null) {
for (NodeInfo node : group.getNodes()) {
if (node.getName().equals(targetName)) {
nodes.add(node);
break;
}
}
if (!nodes.isEmpty()) {
break;
}
}
}
success=softwareManager.startNodes(clusterBlueprint.getName(),nodes,queue);
break;
case QUERY:
ClusterReport report=softwareManager.queryClusterStatus(clusterBlueprint);
queue.addClusterReport(report);
success=true;
break;
case RESIZE:
AuAssert.check(chunkContext != null);
List<String> addedNodes=getResizedVmNames(chunkContext,clusterBlueprint);
success=softwareManager.scaleOutCluster(clusterBlueprint,addedNodes,queue,force);
break;
default :
success=true;
}
}
 catch (Throwable t) {
logger.error("String_Node_Str" + managementOperation.name() + "String_Node_Str"+ targetName,t);
result.put("String_Node_Str",t.getMessage());
}
 finally {
if (progressThread != null) {
monitor.setStop(true);
progressThread.interrupt();
progressThread.join();
}
}
result.put("String_Node_Str",success);
if (!success) {
logger.error("String_Node_Str" + result.get("String_Node_Str"));
}
return result;
}

Fixed version (ground truth):
@Override public Map<String,Object> call() throws Exception {
  Map<String,Object> result=new HashMap<String,Object>();
  ClusterReportQueue queue=new ClusterReportQueue();
  Thread progressThread=null;
  ExternalProgressMonitor monitor=new ExternalProgressMonitor(targetName,queue,statusUpdater,lockedClusterEntityManager);
  progressThread=new Thread(monitor,"String_Node_Str" + targetName);
  progressThread.setDaemon(true);
  progressThread.start();
  boolean success=false;
  boolean force=false;
  if (chunkContext != null) {
    force=JobUtils.getJobParameterForceClusterOperation(chunkContext);
  }
  try {
switch (managementOperation) {
case CREATE:
      success=softwareManager.createCluster(clusterBlueprint,queue);
    break;
case CONFIGURE:
  success=softwareManager.reconfigCluster(clusterBlueprint,queue);
break;
case PRE_DESTROY:
if (softwareManager == null) {
logger.warn("String_Node_Str" + clusterBlueprint.getName() + "String_Node_Str");
logger.warn("String_Node_Str");
success=true;
}
 else {
try {
  softwareManager.onDeleteCluster(clusterBlueprint,queue);
}
 catch (Exception e) {
  String errMsg="String_Node_Str" + softwareManager.getName() + "String_Node_Str";
  logger.error(errMsg,e);
}
success=true;
}
break;
case DESTROY:
success=softwareManager.deleteCluster(clusterBlueprint,queue);
break;
case START:
success=softwareManager.startCluster(clusterBlueprint,queue,force);
break;
case STOP:
success=softwareManager.onStopCluster(clusterBlueprint,queue);
break;
case START_NODES:
List<NodeInfo> nodes=new ArrayList<NodeInfo>();
for (NodeGroupInfo group : clusterBlueprint.getNodeGroups()) {
if (group != null) {
for (NodeInfo node : group.getNodes()) {
if (node.getName().equals(targetName)) {
nodes.add(node);
break;
}
}
if (!nodes.isEmpty()) {
break;
}
}
}
success=softwareManager.startNodes(clusterBlueprint.getName(),nodes,queue);
break;
case QUERY:
ClusterReport report=softwareManager.queryClusterStatus(clusterBlueprint);
queue.addClusterReport(report);
success=true;
break;
case RESIZE:
AuAssert.check(chunkContext != null);
List<String> addedNodes=getResizedVmNames(chunkContext,clusterBlueprint);
success=softwareManager.scaleOutCluster(clusterBlueprint,addedNodes,queue,force);
break;
case ADD:
List<String> addedNodeGroups=getNewNodeGroupVmNames(chunkContext,clusterBlueprint);
success=softwareManager.scaleOutCluster(clusterBlueprint,addedNodeGroups,queue,force);
default :
success=true;
}
}
 catch (Throwable t) {
logger.error("String_Node_Str" + managementOperation.name() + "String_Node_Str"+ targetName,t);
result.put("String_Node_Str",t.getMessage());
}
 finally {
if (progressThread != null) {
monitor.setStop(true);
progressThread.interrupt();
progressThread.join();
}
}
result.put("String_Node_Str",success);
if (!success) {
logger.error("String_Node_Str" + result.get("String_Node_Str"));
}
return result;
}