Program: 177949
Project: 177949
Buggy source:
/** 
 * It manufactures and returns the value for a POJO attribute.
 * @param pojoClass The POJO class being filled with values
 * @param attributeType The type of the attribute for which a value is being manufactured
 * @param annotations The annotations for the attribute being considered
 * @param attributeName The attribute name
 * @param typeArgsMap a map relating the generic class arguments ("<T, V>" for example) with their actual types
 * @param genericTypeArgs The generic type arguments for the current generic class instance
 * @return The value for an attribute
 * @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
 * @throws ClassNotFoundException If it was not possible to create a class from a string
 * @throws IllegalArgumentException <ul> <li>If an illegal argument was passed</li> <li>If an invalid value was set for a precise value in an annotation and such value could not be converted to the desired type</li> </ul>
 */
@SuppressWarnings("String_Node_Str") private Object manufactureAttributeValue(Class<?> pojoClass,Class<?> attributeType,List<Annotation> annotations,String attributeName,Map<String,Type> typeArgsMap,Type... genericTypeArgs) throws InstantiationException, IllegalAccessException, InvocationTargetException, IllegalArgumentException, ClassNotFoundException {
  Object attributeValue=null;
  Class<?> realAttributeType;
  if (genericTypeArgs.length > 0 && genericTypeArgs[0] instanceof Class && attributeType.isAssignableFrom((Class)genericTypeArgs[0])) {
    realAttributeType=(Class)genericTypeArgs[0];
  }
 else {
    realAttributeType=attributeType;
  }
  AttributeMetadata attributeMetadata=new AttributeMetadata(attributeName,realAttributeType,annotations);
  if (realAttributeType.isPrimitive()) {
    attributeValue=resolvePrimitiveValue(realAttributeType,annotations,attributeMetadata);
  }
 else   if (isWrapper(realAttributeType)) {
    attributeValue=resolveWrapperValue(realAttributeType,annotations,attributeMetadata);
  }
 else   if (realAttributeType.equals(String.class)) {
    attributeValue=resolveStringValue(annotations,attributeMetadata);
  }
 else   if (realAttributeType.getName().startsWith("String_Node_Str")) {
    attributeValue=resolveArrayElementValue(realAttributeType,annotations,pojoClass,attributeName,typeArgsMap);
  }
 else   if (Collection.class.isAssignableFrom(realAttributeType)) {
    attributeValue=resolveCollectionValueWhenCollectionIsPojoAttribute(pojoClass,realAttributeType,attributeName,annotations,typeArgsMap,genericTypeArgs);
  }
 else   if (Map.class.isAssignableFrom(realAttributeType)) {
    attributeValue=resolveMapValueWhenMapIsPojoAttribute(pojoClass,realAttributeType,attributeName,annotations,typeArgsMap,genericTypeArgs);
  }
 else   if (realAttributeType.getName().startsWith("String_Node_Str") || realAttributeType.getName().startsWith("String_Node_Str")) {
    attributeValue=createNewInstanceForClassWithoutConstructors(pojoClass,realAttributeType,genericTypeArgs);
  }
 else   if (realAttributeType.isEnum()) {
    int enumConstantsLength=realAttributeType.getEnumConstants().length;
    if (enumConstantsLength > 0) {
      int enumIndex=strategy.getIntegerInRange(0,enumConstantsLength,attributeMetadata) % enumConstantsLength;
      attributeValue=realAttributeType.getEnumConstants()[enumIndex];
    }
  }
 else {
    attributeValue=this.manufacturePojo(realAttributeType,genericTypeArgs);
  }
  return attributeValue;
}

Fixed version (ground truth):
/** 
 * It manufactures and returns the value for a POJO attribute.
 * @param pojoClass The POJO class being filled with values
 * @param attributeType The type of the attribute for which a value is being manufactured
 * @param annotations The annotations for the attribute being considered
 * @param attributeName The attribute name
 * @param typeArgsMap a map relating the generic class arguments ("<T, V>" for example) with their actual types
 * @param genericTypeArgs The generic type arguments for the current generic class instance
 * @return The value for an attribute
 * @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
 * @throws ClassNotFoundException If it was not possible to create a class from a string
 * @throws IllegalArgumentException <ul> <li>If an illegal argument was passed</li> <li>If an invalid value was set for a precise value in an annotation and such value could not be converted to the desired type</li> </ul>
 */
@SuppressWarnings("String_Node_Str") private Object manufactureAttributeValue(Class<?> pojoClass,Class<?> attributeType,List<Annotation> annotations,String attributeName,Map<String,Type> typeArgsMap,Type... genericTypeArgs) throws InstantiationException, IllegalAccessException, InvocationTargetException, IllegalArgumentException, ClassNotFoundException {
  int depth=0;
  return manufactureAttributeValueInternal(pojoClass,depth,attributeType,annotations,attributeName,typeArgsMap,genericTypeArgs);
}