Program: 48590
Project: 48590
Buggy source:
/** 
 * Create default cluster spec.
 * @param type cluster type
 * @return default cluster spec
 * @throws FileNotFoundException
 */
public static ClusterCreate createDefaultSpec(ClusterType type,String vendor,String distroVersion) throws FileNotFoundException {
  if (vendor.trim().equalsIgnoreCase(Constants.MAPR_VENDOR)) {
switch (type) {
case HDFS_MAPRED:
      return loadFromFile(locateSpecFile(HDFS_MAPRED_MAPR_TEMPLATE_SPEC));
case HDFS_HBASE:
    return loadFromFile(locateSpecFile(HDFS_HBASE_MAPR_TEMPLATE_SPEC));
default :
  throw BddException.INVALID_PARAMETER("String_Node_Str",type);
}
}
 else if (vendor.trim().equalsIgnoreCase(Constants.GPHD_VENDOR)) {
switch (type) {
case HDFS:
return loadFromFile(locateSpecFile(HDFS_GPHD_TEMPLATE_SPEC));
case HDFS_MAPRED:
return loadFromFile(locateSpecFile(HDFS_MAPRED_GPHD_TEMPLATE_SPEC));
case HDFS_HBASE:
return loadFromFile(locateSpecFile(HDFS_HBASE_GPHD_TEMPLATE_SPEC));
default :
throw BddException.INVALID_PARAMETER("String_Node_Str",type);
}
}
 else {
MAPREDUCE_VERSION mr=getDefaultMapReduceVersion(vendor,distroVersion);
switch (type) {
case HDFS:
return loadFromFile(locateSpecFile(HDFS_TEMPLATE_SPEC));
case HDFS_MAPRED:
if (mr == MAPREDUCE_VERSION.V1) {
return loadFromFile(locateSpecFile(HDFS_MAPRED_TEMPLATE_SPEC));
}
 else {
return loadFromFile(locateSpecFile(HDFS_YARN_TEMPLATE_SPEC));
}
case HDFS_HBASE:
return loadFromFile(locateSpecFile(HDFS_HBASE_TEMPLATE_SPEC));
default :
throw BddException.INVALID_PARAMETER("String_Node_Str",type);
}
}
}

Fixed version (ground truth):
/** 
 * Create default cluster spec.
 * @param type cluster type
 * @return default cluster spec
 * @throws FileNotFoundException
 */
public static ClusterCreate createDefaultSpec(ClusterType type,String vendor,String distroVersion,String appManagerType) throws FileNotFoundException {
  if (vendor.trim().equalsIgnoreCase(Constants.MAPR_VENDOR)) {
switch (type) {
case HDFS_MAPRED:
      return loadFromFile(locateSpecFile(HDFS_MAPRED_MAPR_TEMPLATE_SPEC));
case HDFS_HBASE:
    return loadFromFile(locateSpecFile(HDFS_HBASE_MAPR_TEMPLATE_SPEC));
default :
  throw BddException.INVALID_PARAMETER("String_Node_Str",type);
}
}
 else if (vendor.trim().equalsIgnoreCase(Constants.GPHD_VENDOR)) {
switch (type) {
case HDFS:
return loadFromFile(locateSpecFile(HDFS_GPHD_TEMPLATE_SPEC));
case HDFS_MAPRED:
return loadFromFile(locateSpecFile(HDFS_MAPRED_GPHD_TEMPLATE_SPEC));
case HDFS_HBASE:
return loadFromFile(locateSpecFile(HDFS_HBASE_GPHD_TEMPLATE_SPEC));
default :
throw BddException.INVALID_PARAMETER("String_Node_Str",type);
}
}
 else {
MAPREDUCE_VERSION mr=getDefaultMapReduceVersion(vendor,distroVersion);
if (appManagerType.equals(Constants.CLOUDERA_MANAGER_PLUGIN_TYPE)) {
if (mr == MAPREDUCE_VERSION.V1) {
return loadFromFile(locateSpecFile(CM_HDFS_MAPRED_TEMPLATE_SPEC));
}
 else {
return loadFromFile(locateSpecFile(CM_HDFS_YARN_TEMPLATE_SPEC));
}
}
switch (type) {
case HDFS:
return loadFromFile(locateSpecFile(HDFS_TEMPLATE_SPEC));
case HDFS_MAPRED:
if (mr == MAPREDUCE_VERSION.V1) {
return loadFromFile(locateSpecFile(HDFS_MAPRED_TEMPLATE_SPEC));
}
 else {
return loadFromFile(locateSpecFile(HDFS_YARN_TEMPLATE_SPEC));
}
case HDFS_HBASE:
return loadFromFile(locateSpecFile(HDFS_HBASE_TEMPLATE_SPEC));
default :
throw BddException.INVALID_PARAMETER("String_Node_Str",type);
}
}
}