public static Type resolveType ( Type targetType , Type rootType ) { Type resolvedType ; if ( targetType instanceof ParameterizedType && rootType instanceof ParameterizedType ) { ParameterizedType parameterizedType = ( ParameterizedType ) targetType ; resolvedType = resolveType ( ( Class < ? > ) parameterizedType . getRawType ( ) , parameterizedType . getActualTypeArguments ( ) , getTypeClass ( rootType ) ) ; } else { resolvedType = resolveType ( getTypeClass ( rootType ) , null , getTypeClass ( targetType ) ) ; } return resolvedType ; }
Find and replace the generic parameters with the real types .