Program: 130210
Project: 130210
Buggy source:
private static void getHadoopConfigurationFromUser(HadoopConfigurationPropertyLoader hcpl) throws IOException {
  String hadoopHome;
  String hadoopType;
  String distributionType;
  Properties prop=new Properties();
  prop.load(JumbuneAgent.class.getClassLoader().getResourceAsStream(DISTRIBUTION_PROPERTIES));
  hadoopType=prop.getProperty(HADOOP_DISTRIBUTION);
  if (hadoopType.equalsIgnoreCase(YARN)) {
    CONSOLE_LOGGER.info("String_Node_Str");
    distributionType=SCANNER.nextLine().trim();
    while (distributionType.isEmpty() || (!distributionType.equalsIgnoreCase(A) && !distributionType.equalsIgnoreCase(H) && !distributionType.equalsIgnoreCase(C))) {
      CONSOLE_LOGGER.info("String_Node_Str");
      distributionType=SCANNER.nextLine().trim();
    }
  }
 else {
    CONSOLE_LOGGER.info("String_Node_Str");
    distributionType=SCANNER.nextLine().trim();
    while (distributionType.isEmpty() || (!distributionType.equalsIgnoreCase(A) && !distributionType.equalsIgnoreCase(M))) {
      CONSOLE_LOGGER.info("String_Node_Str");
      distributionType=SCANNER.nextLine().trim();
    }
  }
  hadoopHome=System.getenv("String_Node_Str");
  String promptedHadoopHome;
  if (hadoopHome != null && !"String_Node_Str".equals(hadoopHome.trim())) {
    CONSOLE_LOGGER.info("String_Node_Str" + hadoopHome + "String_Node_Str");
    promptedHadoopHome=SCANNER.nextLine().trim();
    if ("String_Node_Str".equals(promptedHadoopHome)) {
      promptedHadoopHome=hadoopHome;
    }
  }
 else {
    CONSOLE_LOGGER.info("String_Node_Str");
    promptedHadoopHome=SCANNER.nextLine().trim();
    if ("String_Node_Str".equals(promptedHadoopHome)) {
      promptedHadoopHome="String_Node_Str";
    }
  }
  hadoopHome=validateHadoopHome(promptedHadoopHome);
  hcpl.setHadoopHome(hadoopHome);
  hcpl.setDistributionType(distributionType);
  hcpl.setHadoopType(hadoopType);
  CONSOLE_LOGGER.info("String_Node_Str");
  String hasSeparateUsers=SCANNER.nextLine().trim();
  while (!("String_Node_Str".equalsIgnoreCase(hasSeparateUsers) || "String_Node_Str".equalsIgnoreCase(hasSeparateUsers))) {
    CONSOLE_LOGGER.info("String_Node_Str");
    hasSeparateUsers=SCANNER.nextLine().trim();
  }
  String hdfsUser;
  String yarnUser;
  String mapredUser;
  String hdfsPasswd=null;
  String yarnPasswd=null;
  String mapredPasswd=null;
  if ("String_Node_Str".equalsIgnoreCase(hasSeparateUsers)) {
    CONSOLE_LOGGER.info("String_Node_Str");
    hdfsUser=SCANNER.nextLine().trim();
    if ("String_Node_Str".equals(hdfsUser)) {
      hdfsUser="String_Node_Str";
      yarnUser="String_Node_Str";
      mapredUser="String_Node_Str";
    }
 else {
      mapredUser=yarnUser=hdfsUser;
    }
    hdfsPasswd=promptPassword(hdfsUser);
    mapredPasswd=yarnPasswd=hdfsPasswd;
  }
 else {
    CONSOLE_LOGGER.info("String_Node_Str");
    hdfsUser=SCANNER.nextLine().trim();
    if ("String_Node_Str".equals(hdfsUser)) {
      hdfsUser="String_Node_Str";
    }
    hdfsPasswd=promptPassword(hdfsUser);
    CONSOLE_LOGGER.info("String_Node_Str");
    yarnUser=SCANNER.nextLine().trim();
    if ("String_Node_Str".equals(yarnUser)) {
      yarnUser="String_Node_Str";
    }
    yarnPasswd=promptPassword(yarnUser);
    CONSOLE_LOGGER.info("String_Node_Str");
    mapredUser=SCANNER.nextLine().trim();
    if ("String_Node_Str".equals(mapredUser)) {
      mapredUser="String_Node_Str";
    }
    mapredPasswd=promptPassword(mapredUser);
  }
  hcpl.setYarnUser(yarnUser);
  hcpl.setYarnPasswd(yarnPasswd);
  hcpl.setHdfsUser(hdfsUser);
  hcpl.setHdfsPasswd(hdfsPasswd);
  hcpl.setMapredUser(mapredUser);
  hcpl.setMapredPasswd(mapredPasswd);
  hcpl.persistPropertiesToDisk();
}

Fixed version (ground truth):
private static void getHadoopConfigurationFromUser(HadoopConfigurationPropertyLoader hcpl) throws IOException {
  String hadoopHome;
  String hadoopType;
  String distributionType;
  Properties prop=new Properties();
  prop.load(JumbuneAgent.class.getClassLoader().getResourceAsStream(DISTRIBUTION_PROPERTIES));
  hadoopType=prop.getProperty(HADOOP_DISTRIBUTION);
  if (hadoopType.equalsIgnoreCase(YARN)) {
    CONSOLE_LOGGER.info("String_Node_Str");
    distributionType=SCANNER.nextLine().trim();
    while (distributionType.isEmpty() || (!distributionType.equalsIgnoreCase(A) && !distributionType.equalsIgnoreCase(H) && !distributionType.equalsIgnoreCase(C))) {
      CONSOLE_LOGGER.info("String_Node_Str");
      distributionType=SCANNER.nextLine().trim();
    }
  }
 else {
    CONSOLE_LOGGER.info("String_Node_Str");
    distributionType=SCANNER.nextLine().trim();
    while (distributionType.isEmpty() || (!distributionType.equalsIgnoreCase(A) && !distributionType.equalsIgnoreCase(M))) {
      CONSOLE_LOGGER.info("String_Node_Str");
      distributionType=SCANNER.nextLine().trim();
    }
  }
  hadoopHome=System.getenv("String_Node_Str");
  String promptedHadoopHome;
  if (hadoopHome != null && !"String_Node_Str".equals(hadoopHome.trim())) {
    CONSOLE_LOGGER.info("String_Node_Str" + hadoopHome + "String_Node_Str");
    promptedHadoopHome=SCANNER.nextLine().trim();
    if ("String_Node_Str".equals(promptedHadoopHome)) {
      promptedHadoopHome=hadoopHome;
    }
  }
 else {
    CONSOLE_LOGGER.info("String_Node_Str");
    promptedHadoopHome=SCANNER.nextLine().trim();
    if ("String_Node_Str".equals(promptedHadoopHome)) {
      promptedHadoopHome="String_Node_Str";
    }
  }
  hadoopHome=validateHadoopHome(promptedHadoopHome);
  hcpl.setHadoopHome(hadoopHome);
  hcpl.setDistributionType(distributionType);
  hcpl.setHadoopType(hadoopType);
  String currentWorkingUser=System.getProperty("String_Node_Str");
  CONSOLE_LOGGER.info("String_Node_Str");
  String hasSeparateUsers=SCANNER.nextLine().trim();
  while (!("String_Node_Str".equalsIgnoreCase(hasSeparateUsers) || "String_Node_Str".equalsIgnoreCase(hasSeparateUsers))) {
    CONSOLE_LOGGER.info("String_Node_Str");
    hasSeparateUsers=SCANNER.nextLine().trim();
  }
  String hdfsUser;
  String yarnUser;
  String mapredUser;
  String hdfsPasswd=null;
  String yarnPasswd=null;
  String mapredPasswd=null;
  if ("String_Node_Str".equalsIgnoreCase(hasSeparateUsers)) {
    CONSOLE_LOGGER.info("String_Node_Str" + currentWorkingUser + "String_Node_Str");
    hdfsUser=SCANNER.nextLine().trim();
    if ("String_Node_Str".equals(hdfsUser)) {
      hdfsUser=currentWorkingUser;
      yarnUser=currentWorkingUser;
      mapredUser=currentWorkingUser;
    }
 else {
      mapredUser=yarnUser=hdfsUser;
    }
    hdfsPasswd=promptPassword(hdfsUser);
    mapredPasswd=yarnPasswd=hdfsPasswd;
  }
 else {
    CONSOLE_LOGGER.info("String_Node_Str");
    hdfsUser=SCANNER.nextLine().trim();
    if ("String_Node_Str".equals(hdfsUser)) {
      hdfsUser="String_Node_Str";
    }
    hdfsPasswd=promptPassword(hdfsUser);
    CONSOLE_LOGGER.info("String_Node_Str");
    yarnUser=SCANNER.nextLine().trim();
    if ("String_Node_Str".equals(yarnUser)) {
      yarnUser="String_Node_Str";
    }
    yarnPasswd=promptPassword(yarnUser);
    CONSOLE_LOGGER.info("String_Node_Str");
    mapredUser=SCANNER.nextLine().trim();
    if ("String_Node_Str".equals(mapredUser)) {
      mapredUser="String_Node_Str";
    }
    mapredPasswd=promptPassword(mapredUser);
  }
  hcpl.setYarnUser(yarnUser);
  hcpl.setYarnPasswd(yarnPasswd);
  hcpl.setHdfsUser(hdfsUser);
  hcpl.setHdfsPasswd(hdfsPasswd);
  hcpl.setMapredUser(mapredUser);
  hcpl.setMapredPasswd(mapredPasswd);
  hcpl.persistPropertiesToDisk();
}