Program: 14066
Project: 14066
Buggy source:
private List<String> populateObject(final GroovyObject obj,final Map<String,String> paramFieldMap,final Map<String,String> params){
  final List<String> failedMappings=new ArrayList<String>();
  for (  final Map.Entry<String,String> e : paramFieldMap.entrySet()) {
    try {
      if (getRecursiveField(obj.getClass(),e.getValue()).getType().equals(ArrayList.class)) {
        failedMappings.addAll(this.populateObjectList(obj,e,params,params.size()));
      }
    }
 catch (    final Exception e1) {
      LOG.debug("String_Node_Str",e1);
      failedMappings.add(e.getKey());
    }
  }
  for (  final Map.Entry<String,String> e : paramFieldMap.entrySet()) {
    Field field=null;
    Class<?> declaredType=null;
    try {
      field=getRecursiveField(obj.getClass(),e.getValue());
      declaredType=field.getType();
    }
 catch (    final Exception e2) {
      LOG.debug("String_Node_Str" + e.getValue(),e2);
    }
    if (params.containsKey(e.getKey()) && (declaredType == null || !EucalyptusData.class.isAssignableFrom(declaredType)) && !this.populateObjectField(obj,e,params)) {
      failedMappings.add(e.getKey());
    }
 else     if ((declaredType != null) && EucalyptusData.class.isAssignableFrom(declaredType)) {
      try {
        final Map<String,String> fieldMap=this.buildFieldMap(declaredType);
        final Object newInstance=declaredType.newInstance();
        Map<String,String> subParams=Maps.newHashMap();
        HttpEmbedded httpEmbedded=null;
        if (field != null && (field.isAnnotationPresent(HttpEmbedded.class) || field.isAnnotationPresent(HttpEmbeddeds.class))) {
          httpEmbedded=getHttpEmbeddedAnnotation(field);
        }
        if (httpEmbedded != null && !httpEmbedded.multiple()) {
          subParams=params;
        }
 else {
          for (          final String item : Sets.newHashSet(params.keySet())) {
            if (item.startsWith(e.getKey() + "String_Node_Str") || item.equals(e.getKey())) {
              subParams.put(item.replace(e.getKey() + "String_Node_Str","String_Node_Str"),params.remove(item));
            }
          }
        }
        if (!subParams.isEmpty()) {
          if (httpEmbedded == null && subParams.size() == 1 && subParams.keySet().contains(e.getKey())) {
            try {
              if (populateValue(declaredType,(GroovyObject)newInstance,Iterables.getOnlyElement(subParams.values())).isEmpty()) {
                obj.setProperty(e.getValue(),newInstance);
                subParams.clear();
              }
            }
 catch (            final IllegalArgumentException e2) {
            }
            if (subParams != params)             for (            Map.Entry<String,String> entry : subParams.entrySet()) {
              params.put(entry.getKey(),entry.getValue());
            }
          }
 else {
            this.populateObject((GroovyObject)newInstance,fieldMap,subParams);
            obj.setProperty(e.getValue(),newInstance);
            if (subParams != params)             for (            Map.Entry<String,String> entry : subParams.entrySet()) {
              params.put(e.getKey() + "String_Node_Str" + entry.getKey(),entry.getValue());
            }
          }
        }
 else         if (params.containsKey(e.getKey())) {
          obj.setProperty(e.getValue(),newInstance);
        }
      }
 catch (      final Exception e1) {
        LOG.debug("String_Node_Str",e1);
      }
    }
 else {
      failedMappings.remove(e.getKey());
    }
  }
  return failedMappings;
}

Fixed version (ground truth):
private List<String> populateObject(final GroovyObject obj,final Map<String,String> paramFieldMap,final Map<String,String> params){
  final List<String> failedMappings=new ArrayList<String>();
  for (  final Map.Entry<String,String> e : paramFieldMap.entrySet()) {
    try {
      if (getRecursiveField(obj.getClass(),e.getValue()).getType().equals(ArrayList.class)) {
        failedMappings.addAll(this.populateObjectList(obj,e,params,params.size()));
      }
    }
 catch (    final Exception e1) {
      LOG.debug("String_Node_Str",e1);
      failedMappings.add(e.getKey());
    }
  }
  for (  final Map.Entry<String,String> e : paramFieldMap.entrySet()) {
    Field field=null;
    Class<?> declaredType=null;
    try {
      field=getRecursiveField(obj.getClass(),e.getValue());
      declaredType=field.getType();
    }
 catch (    final Exception e2) {
      LOG.debug("String_Node_Str" + e.getValue(),e2);
    }
    if (params.containsKey(e.getKey()) && (declaredType == null || !EucalyptusData.class.isAssignableFrom(declaredType)) && !this.populateObjectField(obj,e,params)) {
      failedMappings.add(e.getKey());
    }
 else     if ((declaredType != null) && EucalyptusData.class.isAssignableFrom(declaredType)) {
      try {
        final Map<String,String> fieldMap=this.buildFieldMap(declaredType);
        final Object newInstance=declaredType.newInstance();
        Map<String,String> subParams=Maps.newHashMap();
        HttpEmbedded httpEmbedded=null;
        if (field != null && (field.isAnnotationPresent(HttpEmbedded.class) || field.isAnnotationPresent(HttpEmbeddeds.class))) {
          httpEmbedded=getHttpEmbeddedAnnotation(field);
        }
        if (httpEmbedded != null && !httpEmbedded.multiple()) {
          subParams=params;
        }
 else {
          for (          final String item : Sets.newHashSet(params.keySet())) {
            if (item.startsWith(e.getKey() + "String_Node_Str") || item.equals(e.getKey())) {
              subParams.put(replaceStringPrefixIfExists(item,e.getKey() + "String_Node_Str","String_Node_Str"),params.remove(item));
            }
          }
        }
        if (!subParams.isEmpty()) {
          if (httpEmbedded == null && subParams.size() == 1 && subParams.keySet().contains(e.getKey())) {
            try {
              if (populateValue(declaredType,(GroovyObject)newInstance,Iterables.getOnlyElement(subParams.values())).isEmpty()) {
                obj.setProperty(e.getValue(),newInstance);
                subParams.clear();
              }
            }
 catch (            final IllegalArgumentException e2) {
            }
            if (subParams != params)             for (            Map.Entry<String,String> entry : subParams.entrySet()) {
              params.put(entry.getKey(),entry.getValue());
            }
          }
 else {
            this.populateObject((GroovyObject)newInstance,fieldMap,subParams);
            obj.setProperty(e.getValue(),newInstance);
            if (subParams != params)             for (            Map.Entry<String,String> entry : subParams.entrySet()) {
              params.put(e.getKey() + "String_Node_Str" + entry.getKey(),entry.getValue());
            }
          }
        }
 else         if (params.containsKey(e.getKey())) {
          obj.setProperty(e.getValue(),newInstance);
        }
      }
 catch (      final Exception e1) {
        LOG.debug("String_Node_Str",e1);
      }
    }
 else {
      failedMappings.remove(e.getKey());
    }
  }
  return failedMappings;
}