Program: 125647
Project: 125647
Buggy source:
/** 
 * DOC ycbai Comment method "getHadoopPropertiesFullList". <p> Get the full list type of hadoop properties (with the parent properties of the hadoop cluster it belongs) from json string. </p>
 * @param connection
 * @param propertiesJsonStr
 * @param includeQuotes
 * @return
 */
public static List<Map<String,Object>> getHadoopPropertiesFullList(Connection connection,String propertiesJsonStr,boolean includeQuotes){
  IHadoopClusterService hadoopClusterService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopClusterService.class)) {
    hadoopClusterService=(IHadoopClusterService)GlobalServiceRegister.getDefault().getService(IHadoopClusterService.class);
  }
  List<Map<String,Object>> parentProperties=null;
  if (hadoopClusterService != null) {
    Connection hadoopClusterConnection=hadoopClusterService.getHadoopClusterConnectionBySubConnection(connection);
    if (hadoopClusterConnection != null) {
      parentProperties=getHadoopPropertiesList(hadoopClusterService.getHadoopClusterProperties(connection),hadoopClusterConnection.isContextMode(),true);
    }
  }
  List<Map<String,Object>> properties=getHadoopPropertiesList(propertiesJsonStr,connection.isContextMode(),true);
  Map<String,Map<String,Object>> propertiesMap=new HashMap<String,Map<String,Object>>();
  for (  Map<String,Object> proMap : properties) {
    String property=String.valueOf(proMap.get("String_Node_Str"));
    propertiesMap.put(property,proMap);
  }
  if (parentProperties != null) {
    for (    Map<String,Object> parentProMap : parentProperties) {
      String property=String.valueOf(parentProMap.get("String_Node_Str"));
      if (!propertiesMap.containsKey(property)) {
        propertiesMap.put(property,parentProMap);
        properties.add(parentProMap);
      }
    }
  }
  return properties;
}

Fixed version (ground truth):
public static List<Map<String,Object>> getHadoopPropertiesFullList(Connection connection,String propertiesJsonStr,ContextType clusterContextType,ContextType contextType,boolean includeQuotes){
  IHadoopClusterService hadoopClusterService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopClusterService.class)) {
    hadoopClusterService=(IHadoopClusterService)GlobalServiceRegister.getDefault().getService(IHadoopClusterService.class);
  }
  List<Map<String,Object>> parentProperties=null;
  if (hadoopClusterService != null) {
    Connection hadoopClusterConnection=hadoopClusterService.getHadoopClusterConnectionBySubConnection(connection);
    if (hadoopClusterConnection != null) {
      parentProperties=getHadoopPropertiesWithOriginalValue(hadoopClusterService.getHadoopClusterProperties(connection),clusterContextType,includeQuotes);
    }
  }
  List<Map<String,Object>> properties=getHadoopPropertiesWithOriginalValue(propertiesJsonStr,contextType,includeQuotes);
  Map<String,Map<String,Object>> propertiesMap=new HashMap<String,Map<String,Object>>();
  for (  Map<String,Object> proMap : properties) {
    String property=String.valueOf(proMap.get("String_Node_Str"));
    propertiesMap.put(property,proMap);
  }
  if (parentProperties != null) {
    for (    Map<String,Object> parentProMap : parentProperties) {
      String property=String.valueOf(parentProMap.get("String_Node_Str"));
      if (!propertiesMap.containsKey(property)) {
        propertiesMap.put(property,parentProMap);
        properties.add(parentProMap);
      }
    }
  }
  return properties;
}