Program: 48478
Project: 48478
Buggy source:
public void setVolumns(List<String> volumns,HdfsVersion hdfsVersion){
  if (volumns.isEmpty()) {
    return;
  }
  for (  String component : components) {
switch (component) {
case "String_Node_Str":
      String dfsNameDir=Constants.CONFIG_DFS_NAMENODE_NAME_DIR;
    if (hdfsVersion.isHdfsV1()) {
      dfsNameDir=Constants.CONFIG_DFS_NAME_DIR;
    }
  addConfiguration(Constants.CONFIG_HDFS_SITE,dfsNameDir,dataDirs(volumns,"String_Node_Str"));
break;
case "String_Node_Str":
String dfsCheckpointDir=Constants.CONFIG_DFS_NAMENODE_CHECKPOINT_DIR;
if (hdfsVersion.isHdfsV1()) {
dfsCheckpointDir=Constants.CONFIG_DFS_CHECKPOINT_DIR;
}
addConfiguration(Constants.CONFIG_HDFS_SITE,dfsCheckpointDir,volumns.get(0) + "String_Node_Str");
break;
case "String_Node_Str":
String dfsDataDir=Constants.CONFIG_DFS_DATANODE_DATA_DIR;
if (hdfsVersion.isHdfsV1()) {
dfsDataDir=Constants.CONFIG_DFS_DATA_DIR;
}
addConfiguration(Constants.CONFIG_HDFS_SITE,dfsDataDir,dataDirs(volumns,"String_Node_Str"));
break;
case "String_Node_Str":
addConfiguration(Constants.CONFIG_YARN_SITE,Constants.CONFIG_YARN_NODEMANAGER_LOCAL_DIRS,dataDirs(volumns,"String_Node_Str"));
break;
case "String_Node_Str":
addConfiguration(Constants.CONFIG_HDFS_SITE,Constants.CONFIG_JOURNALNODE_EDITS_DIR,volumns.get(0) + "String_Node_Str");
break;
case "String_Node_Str":
addConfiguration(Constants.CONFIG_MAPRED_SITE,Constants.CONFIG_MAPRED_LOCAL_DIR,dataDirs(volumns,"String_Node_Str"));
break;
default :
break;
}
}
}

Fixed version (ground truth):
public void setVolumns(List<String> volumns,HdfsVersion hdfsVersion,String ambariServerVersion){
  if (volumns.isEmpty()) {
    return;
  }
  for (  String component : components) {
switch (component) {
case "String_Node_Str":
      String dfsNameDir=Constants.CONFIG_DFS_NAMENODE_NAME_DIR;
    if (hdfsVersion.isHdfsV1()) {
      dfsNameDir=Constants.CONFIG_DFS_NAME_DIR;
    }
  addConfiguration(Constants.CONFIG_HDFS_SITE,dfsNameDir,dataDirs(volumns,"String_Node_Str"));
break;
case "String_Node_Str":
String dfsCheckpointDir=Constants.CONFIG_DFS_NAMENODE_CHECKPOINT_DIR;
if (hdfsVersion.isHdfsV1()) {
dfsCheckpointDir=Constants.CONFIG_DFS_CHECKPOINT_DIR;
}
addConfiguration(Constants.CONFIG_HDFS_SITE,dfsCheckpointDir,volumns.get(0) + "String_Node_Str");
break;
case "String_Node_Str":
if (ambariServerVersion != null && !ambariServerVersion.equals(Constants.AMBARI_SERVER_VERSION_1_6_0)) {
String timelineStorePath=Constants.CONFIG_LEVELDB_TIMELINE_STORE_PATH;
addConfiguration(Constants.CONFIG_YARN_SITE,timelineStorePath,volumns.get(0) + "String_Node_Str");
}
break;
case "String_Node_Str":
String dfsDataDir=Constants.CONFIG_DFS_DATANODE_DATA_DIR;
if (hdfsVersion.isHdfsV1()) {
dfsDataDir=Constants.CONFIG_DFS_DATA_DIR;
}
addConfiguration(Constants.CONFIG_HDFS_SITE,dfsDataDir,dataDirs(volumns,"String_Node_Str"));
break;
case "String_Node_Str":
addConfiguration(Constants.CONFIG_YARN_SITE,Constants.CONFIG_YARN_NODEMANAGER_LOCAL_DIRS,dataDirs(volumns,"String_Node_Str"));
break;
case "String_Node_Str":
addConfiguration(Constants.CONFIG_HDFS_SITE,Constants.CONFIG_JOURNALNODE_EDITS_DIR,volumns.get(0) + "String_Node_Str");
break;
case "String_Node_Str":
addConfiguration(Constants.CONFIG_MAPRED_SITE,Constants.CONFIG_MAPRED_LOCAL_DIR,dataDirs(volumns,"String_Node_Str"));
break;
default :
break;
}
}
}