Program: 48496
Project: 48496
Buggy source:
/** 
 * There are two approach to create a cluster: 1) specify a cluster type and optionally overwriting the parameters 2) specify a customized spec with cluster type not specified
 * @param spec spec with customized field
 * @return customized cluster spec
 * @throws FileNotFoundException
 */
public static ClusterCreate getCustomizedSpec(ClusterCreate spec,String appManagerType) throws FileNotFoundException {
  if ((spec.getType() == null) || (spec.getType() != null && spec.isSpecFile())) {
    return spec;
  }
  ClusterCreate newSpec=createDefaultSpec(spec.getType(),spec.getDistroVendor(),spec.getDistroVersion(),appManagerType);
  if (spec.getName() != null) {
    newSpec.setName(spec.getName());
  }
  newSpec.setPassword(spec.getPassword());
  if (!CommonUtil.isBlank(spec.getAppManager())) {
    newSpec.setAppManager(spec.getAppManager());
  }
  if (spec.getDistro() != null) {
    newSpec.setDistro(spec.getDistro());
  }
  if (spec.getDistroVendor() != null) {
    newSpec.setDistroVendor(spec.getDistroVendor());
  }
  if (spec.getDistroVersion() != null) {
    newSpec.setDistroVersion(spec.getDistroVersion());
  }
  if (spec.getDsNames() != null) {
    newSpec.setDsNames(spec.getDsNames());
  }
  if (spec.getRpNames() != null) {
    newSpec.setRpNames(spec.getRpNames());
  }
  if (spec.getNetworkConfig() != null) {
    newSpec.setNetworkConfig(spec.getNetworkConfig());
  }
  if (spec.getTopologyPolicy() != null) {
    newSpec.setTopologyPolicy(spec.getTopologyPolicy());
  }
  return newSpec;
}

Fixed version (ground truth):
/** 
 * There are two approach to create a cluster: 1) specify a cluster type and optionally overwriting the parameters 2) specify a customized spec with cluster type not specified
 * @param spec spec with customized field
 * @return customized cluster spec
 * @throws FileNotFoundException
 */
public static ClusterCreate getCustomizedSpec(ClusterCreate spec,String appManagerType) throws FileNotFoundException {
  if ((spec.getType() == null) || (spec.getType() != null && spec.isSpecFile())) {
    return spec;
  }
  ClusterCreate newSpec=createDefaultSpec(spec.getType(),spec.getDistroVendor(),spec.getDistroVersion(),appManagerType);
  if (spec.getName() != null) {
    newSpec.setName(spec.getName());
  }
  newSpec.setPassword(spec.getPassword());
  if (!CommonUtil.isBlank(spec.getAppManager())) {
    newSpec.setAppManager(spec.getAppManager());
  }
  if (!CommonUtil.isBlank(spec.getLocalRepoURL())) {
    newSpec.setLocalRepoURL(spec.getLocalRepoURL());
  }
  if (spec.getDistro() != null) {
    newSpec.setDistro(spec.getDistro());
  }
  if (spec.getDistroVendor() != null) {
    newSpec.setDistroVendor(spec.getDistroVendor());
  }
  if (spec.getDistroVersion() != null) {
    newSpec.setDistroVersion(spec.getDistroVersion());
  }
  if (spec.getDsNames() != null) {
    newSpec.setDsNames(spec.getDsNames());
  }
  if (spec.getRpNames() != null) {
    newSpec.setRpNames(spec.getRpNames());
  }
  if (spec.getNetworkConfig() != null) {
    newSpec.setNetworkConfig(spec.getNetworkConfig());
  }
  if (spec.getTopologyPolicy() != null) {
    newSpec.setTopologyPolicy(spec.getTopologyPolicy());
  }
  return newSpec;
}