Program: 124799
Project: 124799
Buggy source:
@Override public void revertPropertiesForContextMode(Connection hadoopConn,ContextType contextType){
  if (hadoopConn instanceof HadoopClusterConnection) {
    HadoopClusterConnection conn=(HadoopClusterConnection)hadoopConn;
    String nameNodeUri=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getNameNodeURI()));
    String jobTrackerUri=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getJobTrackerURI()));
    String rmScheduler=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getRmScheduler()));
    String jobHistory=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getJobHistory()));
    String stagingDir=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getStagingDirectory()));
    String nameNodePrin=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getPrincipal()));
    String jtOrRmPrin=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getValue(conn.getJtOrRmPrincipal(),false)));
    String jobHisPrin=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getJobHistoryPrincipal()));
    String userName=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getUserName()));
    String group=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getGroup()));
    String principal=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getKeytabPrincipal()));
    String keyTab=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getKeytab()));
    for (    String paramKey : ((HadoopClusterConnection)hadoopConn).getParameters().keySet()) {
      String originalValue=ContextParameterUtils.getOriginalValue(contextType,conn.getParameters().get(paramKey));
      conn.getParameters().put(paramKey,originalValue);
    }
    String hadoopProperties=conn.getHadoopProperties();
    List<Map<String,Object>> propertiesAfterRevert=transformContextModeToHadoopProperties(HadoopRepositoryUtil.getHadoopPropertiesList(hadoopProperties),contextType);
    conn.setHadoopProperties(HadoopRepositoryUtil.getHadoopPropertiesJsonStr(propertiesAfterRevert));
    conn.setNameNodeURI(nameNodeUri);
    conn.setJobTrackerURI(jobTrackerUri);
    conn.setRmScheduler(rmScheduler);
    conn.setJobHistory(jobHistory);
    conn.setStagingDirectory(stagingDir);
    conn.setPrincipal(nameNodePrin);
    conn.setJtOrRmPrincipal(jtOrRmPrin);
    conn.setJobHistoryPrincipal(jobHisPrin);
    conn.setUserName(userName);
    conn.setGroup(group);
    conn.setKeytab(keyTab);
    conn.setKeytabPrincipal(principal);
  }
}

Fixed version (ground truth):
@Override public void revertPropertiesForContextMode(Connection hadoopConn,ContextType contextType){
  if (hadoopConn instanceof HadoopClusterConnection) {
    HadoopClusterConnection conn=(HadoopClusterConnection)hadoopConn;
    String nameNodeUri=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getNameNodeURI()));
    String jobTrackerUri=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getJobTrackerURI()));
    String rmScheduler=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getRmScheduler()));
    String jobHistory=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getJobHistory()));
    String stagingDir=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getStagingDirectory()));
    String nameNodePrin=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getPrincipal()));
    String jtOrRmPrin=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getValue(conn.getJtOrRmPrincipal(),false)));
    String jobHisPrin=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getJobHistoryPrincipal()));
    String userName=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getUserName()));
    String group=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getGroup()));
    String principal=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getKeytabPrincipal()));
    String keyTab=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getKeytab()));
    String cnUserName=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getClouderaNaviUserName()));
    String cnPassword=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getClouderaNaviPassword()));
    String cnUrl=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getClouderaNaviUrl()));
    String cnMetadataUrl=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getClouderaNaviMetadataUrl()));
    String cnClientUrl=TalendQuoteUtils.removeQuotes(ContextParameterUtils.getOriginalValue(contextType,conn.getClouderaNaviClientUrl()));
    for (    String paramKey : ((HadoopClusterConnection)hadoopConn).getParameters().keySet()) {
      String originalValue=ContextParameterUtils.getOriginalValue(contextType,conn.getParameters().get(paramKey));
      conn.getParameters().put(paramKey,originalValue);
    }
    String hadoopProperties=conn.getHadoopProperties();
    List<Map<String,Object>> propertiesAfterRevert=transformContextModeToHadoopProperties(HadoopRepositoryUtil.getHadoopPropertiesList(hadoopProperties),contextType);
    conn.setHadoopProperties(HadoopRepositoryUtil.getHadoopPropertiesJsonStr(propertiesAfterRevert));
    conn.setNameNodeURI(nameNodeUri);
    conn.setJobTrackerURI(jobTrackerUri);
    conn.setRmScheduler(rmScheduler);
    conn.setJobHistory(jobHistory);
    conn.setStagingDirectory(stagingDir);
    conn.setPrincipal(nameNodePrin);
    conn.setJtOrRmPrincipal(jtOrRmPrin);
    conn.setJobHistoryPrincipal(jobHisPrin);
    conn.setUserName(userName);
    conn.setGroup(group);
    conn.setKeytab(keyTab);
    conn.setKeytabPrincipal(principal);
    conn.setClouderaNaviUserName(cnUserName);
    conn.setClouderaNaviPassword(cnPassword);
    conn.setClouderaNaviUrl(cnUrl);
    conn.setClouderaNaviMetadataUrl(cnMetadataUrl);
    conn.setClouderaNaviClientUrl(cnClientUrl);
  }
}