@Test public void testDetermineTypeVariableAssignments() throws SecurityException, NoSuchFieldException, NoSuchMethodException { final ParameterizedType iterableType = (ParameterizedType) getClass().getField("iterable") .getGenericType(); final Map<TypeVariable<?>, Type> typeVarAssigns = TypeUtils.determineTypeArguments(TreeSet.class, iterableType); final TypeVariable<?> treeSetTypeVar = TreeSet.class.getTypeParameters()[0]; assertTrue(typeVarAssigns.containsKey(treeSetTypeVar)); assertEquals(iterableType.getActualTypeArguments()[0], typeVarAssigns .get(treeSetTypeVar)); }
return determineTypeArguments((Class<?>) midType, superType); final Map<TypeVariable<?>, Type> typeVarAssigns = determineTypeArguments(midClass, superType);
Map<TypeVariable<?>, Type> commonsMap = TypeUtils.determineTypeArguments((Class<?>)p2.getRawType(), p1); logger.debug("Adding to map: "+commonsMap);
return determineTypeArguments((Class<?>) midType, superType); final Map<TypeVariable<?>, Type> typeVarAssigns = determineTypeArguments(midClass, superType);
return determineTypeArguments((Class<?>) midType, superType); final Map<TypeVariable<?>, Type> typeVarAssigns = determineTypeArguments(midClass, superType);
return determineTypeArguments((Class<?>) midType, superType); final Map<TypeVariable<?>, Type> typeVarAssigns = determineTypeArguments(midClass, superType);
Map<TypeVariable<?>, Type> typeMap = TypeUtils.determineTypeArguments(rawClass, (ParameterizedType) superClass.getType()); return getGenericInstantiation(typeMap);
Class<?> boundRawClass = boundClass.getRawClass(); if(boundRawClass.isAssignableFrom(selectedClass.getRawClass())) { Map<TypeVariable<?>, Type> xmap = TypeUtils.determineTypeArguments(selectedClass.getRawClass(), (ParameterizedType) boundClass.getType()); extendedMap.putAll(xmap);
Class<?> boundClass = GenericTypeReflector.erase(bound); if(boundClass.isAssignableFrom(rawClass)) { Map<TypeVariable<?>, Type> xmap = TypeUtils.determineTypeArguments(rawClass, (ParameterizedType) bound); ownerVariableMap.putAll(xmap);
typeMap.putAll(TypeUtils.determineTypeArguments(rawClass, (ParameterizedType) otherType.getType()));