Program: 48717
Project: 48717
Buggy source:
@Transactional @RetryTransaction public boolean handleOperationStatus(String clusterName,OperationStatusWithDetail status){
  logger.info("String_Node_Str" + status.getOperationStatus());
  boolean finished=status.getOperationStatus().isFinished();
  final Map<String,GroupData> groups=status.getClusterData().getGroups();
  ClusterEntity cluster=findByName(clusterName);
  AuAssert.check(cluster.getId() != null);
  for (  NodeGroupEntity group : cluster.getNodeGroups()) {
    for (    String groupName : groups.keySet()) {
      if (groupName.equals(group.getName())) {
        for (        ServerData serverData : groups.get(groupName).getInstances()) {
          logger.debug("String_Node_Str" + serverData.getName() + "String_Node_Str"+ serverData.getAction()+ "String_Node_Str"+ serverData.getStatus());
          Iterator<NodeEntity> iter=group.getNodes().iterator();
          while (iter.hasNext()) {
            NodeEntity oldNode=iter.next();
            if (oldNode.getVmName().equals(serverData.getName())) {
              logger.debug("String_Node_Str" + oldNode.getVmName() + "String_Node_Str"+ oldNode.getStatus());
              oldNode.setAction(serverData.getAction());
              logger.debug("String_Node_Str" + NodeStatus.fromString(serverData.getStatus()));
              String errorMsg=serverData.getError_msg();
              if (errorMsg != null && !errorMsg.isEmpty()) {
                oldNode.setActionFailed(true);
                oldNode.setErrMessage(errorMsg);
                logger.debug("String_Node_Str" + errorMsg);
              }
              if (!oldNode.isDisconnected()) {
                oldNode.setStatus(NodeStatus.fromString(serverData.getStatus()),false);
                logger.debug("String_Node_Str" + oldNode.getVmName() + "String_Node_Str"+ oldNode.getStatus());
              }
 else {
                logger.debug("String_Node_Str");
              }
              update(oldNode);
              break;
            }
          }
        }
      }
    }
  }
  logger.debug("String_Node_Str");
  return finished;
}

Fixed version (ground truth):
@Transactional @RetryTransaction public boolean handleOperationStatus(String clusterName,OperationStatusWithDetail status,boolean lastUpdate){
  logger.info("String_Node_Str" + status.getOperationStatus());
  boolean finished=status.getOperationStatus().isFinished();
  final Map<String,GroupData> groups=status.getClusterData().getGroups();
  ClusterEntity cluster=findByName(clusterName);
  AuAssert.check(cluster.getId() != null);
  for (  NodeGroupEntity group : cluster.getNodeGroups()) {
    for (    String groupName : groups.keySet()) {
      if (groupName.equals(group.getName())) {
        for (        ServerData serverData : groups.get(groupName).getInstances()) {
          logger.debug("String_Node_Str" + serverData.getName() + "String_Node_Str"+ serverData.getAction()+ "String_Node_Str"+ serverData.getStatus());
          Iterator<NodeEntity> iter=group.getNodes().iterator();
          while (iter.hasNext()) {
            NodeEntity oldNode=iter.next();
            if (oldNode.getVmName().equals(serverData.getName())) {
              logger.debug("String_Node_Str" + oldNode.getVmName() + "String_Node_Str"+ oldNode.getStatus());
              oldNode.setAction(serverData.getAction());
              logger.debug("String_Node_Str" + NodeStatus.fromString(serverData.getStatus()));
              String errorMsg=serverData.getError_msg();
              if (lastUpdate && errorMsg != null && !errorMsg.isEmpty()) {
                oldNode.setActionFailed(true);
                oldNode.setErrMessage(errorMsg);
                logger.debug("String_Node_Str" + errorMsg);
              }
              if (!oldNode.isDisconnected()) {
                oldNode.setStatus(NodeStatus.fromString(serverData.getStatus()),false);
                logger.debug("String_Node_Str" + oldNode.getVmName() + "String_Node_Str"+ oldNode.getStatus());
              }
 else {
                logger.debug("String_Node_Str");
              }
              update(oldNode);
              break;
            }
          }
        }
      }
    }
  }
  logger.debug("String_Node_Str");
  return finished;
}