Program: 48605
Project: 48605
Buggy source:
@Transactional public void updateAppConfig(String clusterName,ClusterCreate clusterCreate){
  logger.debug("String_Node_Str" + clusterName);
  ClusterEntity cluster=clusterEntityMgr.findByName(clusterName);
  if (cluster == null) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str");
    throw BddException.NOT_FOUND("String_Node_Str",clusterName);
  }
  SoftwareManager softwareManager=softwareManagerCollector.getSoftwareManager(cluster.getAppManager());
  if (softwareManager == null) {
    logger.error("String_Node_Str");
    throw new ClusterConfigException(null,"String_Node_Str");
  }
  ClusterBlueprint blueprint=clusterCreate.toBlueprint();
  DistroRead distro=null;
  if (Constants.IRONFAN.equalsIgnoreCase(clusterCreate.getAppManager())) {
    distro=distroMgr.getDistroByName(cluster.getDistro());
  }
 else {
    distro=distroMgr.getDistroByName(clusterCreate.getAppManager(),cluster.getDistro());
  }
  try {
    softwareManager.validateBlueprint(blueprint,distro.getRoles());
  }
 catch (  ValidationException e) {
    throw new ClusterConfigException(e,e.getMessage() + e.getFailedMsgList().toString());
  }
  updateInfrastructure(clusterCreate,softwareManager,blueprint);
  Map<String,Object> clusterLevelConfig=clusterCreate.getConfiguration();
  if (clusterLevelConfig != null && clusterLevelConfig.size() > 0) {
    logger.debug("String_Node_Str");
    cluster.setHadoopConfig((new Gson()).toJson(clusterLevelConfig));
    updateVhmJobTrackerPort(clusterCreate,cluster);
  }
 else {
    logger.debug("String_Node_Str");
    cluster.setHadoopConfig(null);
  }
  updateNodegroupAppConfig(clusterCreate,cluster,clusterCreate.isValidateConfig());
}

Fixed version (ground truth):
@Transactional public void updateAppConfig(String clusterName,ClusterCreate clusterCreate){
  logger.debug("String_Node_Str" + clusterName);
  ClusterEntity cluster=clusterEntityMgr.findByName(clusterName);
  if (cluster == null) {
    logger.error("String_Node_Str" + clusterName + "String_Node_Str");
    throw BddException.NOT_FOUND("String_Node_Str",clusterName);
  }
  SoftwareManager softwareManager=softwareManagerCollector.getSoftwareManager(cluster.getAppManager());
  if (softwareManager == null) {
    logger.error("String_Node_Str");
    throw new ClusterConfigException(null,"String_Node_Str");
  }
  clusterCreate.setDistro(cluster.getDistro());
  clusterCreate.setDistroVersion(cluster.getDistroVersion());
  ClusterBlueprint blueprint=clusterCreate.toBlueprint();
  DistroRead distro=null;
  if (Constants.IRONFAN.equalsIgnoreCase(cluster.getAppManager())) {
    distro=distroMgr.getDistroByName(cluster.getDistro());
  }
 else {
    distro=distroMgr.getDistroByName(cluster.getAppManager(),cluster.getDistro());
  }
  try {
    softwareManager.validateBlueprint(blueprint,distro.getRoles());
  }
 catch (  ValidationException e) {
    throw new ClusterConfigException(e,e.getMessage() + e.getFailedMsgList().toString());
  }
  updateInfrastructure(clusterCreate,softwareManager,blueprint);
  Map<String,Object> clusterLevelConfig=clusterCreate.getConfiguration();
  if (clusterLevelConfig != null && clusterLevelConfig.size() > 0) {
    logger.debug("String_Node_Str");
    cluster.setHadoopConfig((new Gson()).toJson(clusterLevelConfig));
    updateVhmJobTrackerPort(clusterCreate,cluster);
  }
 else {
    logger.debug("String_Node_Str");
    cluster.setHadoopConfig(null);
  }
  updateNodegroupAppConfig(clusterCreate,cluster,clusterCreate.isValidateConfig());
}