Program: 175915
Project: 175915
Buggy source:
/** 
 * It resolves generic parameter type
 * @param paramType The generic parameter type
 * @param typeArgsMap A map of resolved types
 * @param methodGenericTypeArgs Return value posible generic types of the generic parameter type
 * @return value for class representing the generic parameter type
 */
public static Class<?> resolveGenericParameter(Type paramType,Map<String,Type> typeArgsMap,AtomicReference<Type[]> methodGenericTypeArgs){
  Class<?> parameterType=null;
  Map<String,Type> localMap=new HashMap<String,Type>(typeArgsMap);
  methodGenericTypeArgs.set(PodamConstants.NO_TYPES);
  if (paramType instanceof TypeVariable<?>) {
    final TypeVariable<?> typeVariable=(TypeVariable<?>)paramType;
    final Type type=localMap.get(typeVariable.getName());
    if (type != null) {
      parameterType=resolveGenericParameter(type,localMap,methodGenericTypeArgs);
    }
  }
 else   if (paramType instanceof ParameterizedType) {
    ParameterizedType pType=(ParameterizedType)paramType;
    parameterType=(Class<?>)pType.getRawType();
    methodGenericTypeArgs.set(pType.getActualTypeArguments());
  }
 else   if (paramType instanceof WildcardType) {
    WildcardType wType=(WildcardType)paramType;
    Type[] bounds=wType.getLowerBounds();
    String msg;
    if (bounds != null && bounds.length > 0) {
      msg="String_Node_Str";
    }
 else {
      bounds=wType.getUpperBounds();
      msg="String_Node_Str";
    }
    if (bounds != null && bounds.length > 0) {
      LOG.debug(msg + Arrays.toString(bounds));
      parameterType=resolveGenericParameter(bounds[0],localMap,methodGenericTypeArgs);
    }
  }
 else   if (paramType instanceof Class) {
    parameterType=(Class<?>)paramType;
  }
  if (parameterType == null) {
    LOG.warn("String_Node_Str",paramType);
    parameterType=Object.class;
  }
  return parameterType;
}

Fixed version (ground truth):
/** 
 * It resolves generic parameter type
 * @param paramType The generic parameter type
 * @param typeArgsMap A map of resolved types
 * @param methodGenericTypeArgs Return value posible generic types of the generic parameter type
 * @return value for class representing the generic parameter type
 */
public static Class<?> resolveGenericParameter(Type paramType,Map<String,Type> typeArgsMap,AtomicReference<Type[]> methodGenericTypeArgs){
  Class<?> parameterType=null;
  Map<String,Type> localMap=new HashMap<String,Type>(typeArgsMap);
  methodGenericTypeArgs.set(PodamConstants.NO_TYPES);
  if (paramType instanceof Class) {
    parameterType=(Class<?>)paramType;
  }
 else   if (paramType instanceof TypeVariable<?>) {
    final TypeVariable<?> typeVariable=(TypeVariable<?>)paramType;
    final Type type=localMap.get(typeVariable.getName());
    if (type != null) {
      parameterType=resolveGenericParameter(type,localMap,methodGenericTypeArgs);
    }
  }
 else   if (paramType instanceof ParameterizedType) {
    ParameterizedType pType=(ParameterizedType)paramType;
    parameterType=(Class<?>)pType.getRawType();
    Type[] actualTypeArgs=pType.getActualTypeArguments();
    if (!typeArgsMap.isEmpty()) {
      for (int i=0; i < actualTypeArgs.length; i++) {
        Class<?> tmp=resolveGenericParameter(actualTypeArgs[i],localMap,methodGenericTypeArgs);
        if (tmp != actualTypeArgs[i]) {
          if (ArrayUtils.isEmpty(methodGenericTypeArgs.get())) {
            actualTypeArgs[i]=tmp;
          }
        }
      }
    }
    methodGenericTypeArgs.set(actualTypeArgs);
  }
 else   if (paramType instanceof WildcardType) {
    WildcardType wType=(WildcardType)paramType;
    Type[] bounds=wType.getLowerBounds();
    String msg;
    if (bounds != null && bounds.length > 0) {
      msg="String_Node_Str";
    }
 else {
      bounds=wType.getUpperBounds();
      msg="String_Node_Str";
    }
    if (bounds != null && bounds.length > 0) {
      LOG.debug(msg + Arrays.toString(bounds));
      parameterType=resolveGenericParameter(bounds[0],localMap,methodGenericTypeArgs);
    }
  }
  if (parameterType == null) {
    LOG.warn("String_Node_Str",paramType);
    parameterType=Object.class;
  }
  return parameterType;
}