Program: 177917
Project: 177917
Buggy source:
/** 
 * Fills a field with a getter
 * @param < T > The type for which should be populated
 * @param pojo The POJO being filled with values
 * @param attribute a attribute we are filling
 * @param typeArgsMap a map relating the generic class arguments ("&lt;T, V&gt;" for example) with their actual types
 * @param manufacturingCtx the manufacturing context
 * @param genericTypeArgs The generic type arguments for the current generic class instance
 * @return true, if attribute was found and populated
 * @throws ClassNotFoundException If class being manufactured cannot be loaded
 * @throws InstantiationException If an exception occurred during instantiation
 * @throws IllegalAccessException If security was violated while creating the object
 * @throws InvocationTargetException If an exception occurred while invoking the constructor or factory method
 */
private <T>boolean populateReadOnlyField(T pojo,ClassAttribute attribute,Map<String,Type> typeArgsMap,ManufacturingContext manufacturingCtx,Type... genericTypeArgs) throws InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException {
  Method getter=PodamUtils.selectLatestMethod(attribute.getGetters());
  if (getter == null) {
    return false;
  }
  if (getter.getGenericParameterTypes().length > 0) {
    LOG.warn("String_Node_Str",getter);
    return false;
  }
  if (getter.getReturnType().isPrimitive()) {
    return false;
  }
  Object fieldValue=null;
  try {
    fieldValue=getter.invoke(pojo,PodamConstants.NO_ARGS);
  }
 catch (  Exception e) {
    LOG.debug("String_Node_Str",getter);
  }
  if (fieldValue != null) {
    LOG.debug("String_Node_Str",getter);
    Type[] genericTypeArgsAll;
    Map<String,Type> paramTypeArgsMap;
    if (getter.getGenericReturnType() instanceof ParameterizedType) {
      paramTypeArgsMap=new HashMap<String,Type>(typeArgsMap);
      ParameterizedType paramType=(ParameterizedType)getter.getGenericReturnType();
      Type[] actualTypes=paramType.getActualTypeArguments();
      TypeManufacturerUtil.fillTypeArgMap(paramTypeArgsMap,getter.getReturnType(),actualTypes);
      genericTypeArgsAll=TypeManufacturerUtil.fillTypeArgMap(paramTypeArgsMap,getter.getReturnType(),genericTypeArgs);
    }
 else {
      paramTypeArgsMap=typeArgsMap;
      genericTypeArgsAll=genericTypeArgs;
    }
    List<Annotation> pojoAttributeAnnotations=PodamUtils.getAttributeAnnotations(attribute.getAttribute(),getter);
    Class<?> fieldClass=fieldValue.getClass();
    Integer depth=manufacturingCtx.getPojos().get(fieldClass);
    if (depth == null) {
      depth=-1;
    }
    if (depth <= strategy.getMaxDepth(fieldClass)) {
      manufacturingCtx.getPojos().put(fieldClass,depth + 1);
      populatePojoInternal(fieldValue,pojoAttributeAnnotations,manufacturingCtx,paramTypeArgsMap,genericTypeArgsAll);
      manufacturingCtx.getPojos().put(fieldClass,depth);
    }
 else {
      LOG.warn("String_Node_Str" + depth + "String_Node_Str",getter);
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Fills a field with a getter
 * @param < T > The type for which should be populated
 * @param pojo The POJO being filled with values
 * @param attribute a attribute we are filling
 * @param typeArgsMap a map relating the generic class arguments ("&lt;T, V&gt;" for example) with their actual types
 * @param manufacturingCtx the manufacturing context
 * @param genericTypeArgs The generic type arguments for the current generic class instance
 * @return true, if attribute was found and populated
 * @throws ClassNotFoundException If class being manufactured cannot be loaded
 * @throws InstantiationException If an exception occurred during instantiation
 * @throws IllegalAccessException If security was violated while creating the object
 * @throws InvocationTargetException If an exception occurred while invoking the constructor or factory method
 */
private <T>boolean populateReadOnlyField(T pojo,ClassAttribute attribute,Map<String,Type> typeArgsMap,ManufacturingContext manufacturingCtx,Type... genericTypeArgs) throws InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException {
  Method getter=PodamUtils.selectLatestMethod(attribute.getGetters());
  if (getter == null) {
    return false;
  }
  if (getter.getGenericParameterTypes().length > 0) {
    LOG.warn("String_Node_Str",getter);
    return false;
  }
  if (getter.getReturnType().isPrimitive()) {
    return false;
  }
  Object fieldValue=null;
  try {
    fieldValue=getter.invoke(pojo,PodamConstants.NO_ARGS);
  }
 catch (  Exception e) {
    LOG.debug("String_Node_Str",getter);
  }
  if (fieldValue != null) {
    LOG.debug("String_Node_Str",getter);
    Type[] genericTypeArgsAll;
    Map<String,Type> paramTypeArgsMap;
    if (getter.getGenericReturnType() instanceof ParameterizedType) {
      paramTypeArgsMap=new HashMap<String,Type>(typeArgsMap);
      ParameterizedType paramType=(ParameterizedType)getter.getGenericReturnType();
      Type[] actualTypes=paramType.getActualTypeArguments();
      TypeManufacturerUtil.fillTypeArgMap(paramTypeArgsMap,getter.getReturnType(),actualTypes);
      genericTypeArgsAll=TypeManufacturerUtil.fillTypeArgMap(paramTypeArgsMap,getter.getReturnType(),genericTypeArgs);
    }
 else {
      paramTypeArgsMap=typeArgsMap;
      genericTypeArgsAll=genericTypeArgs;
    }
    List<Annotation> pojoAttributeAnnotations=PodamUtils.getAttributeAnnotations(attribute.getAttribute(),getter);
    Class<?> fieldClass=fieldValue.getClass();
    Integer depth=manufacturingCtx.getPojos().get(fieldClass);
    if (depth == null) {
      depth=0;
    }
    if (depth < strategy.getMaxDepth(fieldClass)) {
      manufacturingCtx.getPojos().put(fieldClass,depth + 1);
      populatePojoInternal(fieldValue,pojoAttributeAnnotations,manufacturingCtx,paramTypeArgsMap,genericTypeArgsAll);
      manufacturingCtx.getPojos().put(fieldClass,depth);
    }
 else {
      LOG.warn("String_Node_Str" + depth + "String_Node_Str",getter);
    }
    return true;
  }
 else {
    return false;
  }
}