protected Type mapTypeParameters(Type toMapType,Type typeAndParams){
  if (isMissingTypeParameters(typeAndParams)) {
    logger.debug("Is missing type parameters, so erasing types");
    return GenericTypeReflector.erase(toMapType);
  }
 else {
    VarMap varMap=new VarMap();
    Type handlingTypeAndParams=typeAndParams;
    while (handlingTypeAndParams instanceof ParameterizedType) {
      ParameterizedType pType=(ParameterizedType)handlingTypeAndParams;
      Class<?> clazz=(Class<?>)pType.getRawType();
      varMap.addAll(clazz.getTypeParameters(),pType.getActualTypeArguments());
      handlingTypeAndParams=pType.getOwnerType();
    }
    varMap.addAll(getTypeVariableMap());
    return varMap.map(toMapType);
  }
}

protected Type mapTypeParameters ( Type toMapType , Type typeAndParams ) { if ( isMissingTypeParameters ( typeAndParams ) ) { logger . debug ( "Is missing type parameters, so erasing types" ) ; return GenericTypeReflector . erase ( toMapType ) ; } else { VarMap varMap = new VarMap ( ) ; Type handlingTypeAndParams = typeAndParams ; while ( handlingTypeAndParams instanceof ParameterizedType ) { ParameterizedType pType = ( ParameterizedType ) handlingTypeAndParams ; Class < ? > clazz = ( Class < ? > ) pType . getRawType ( ) ; varMap . addAll ( clazz . getTypeParameters ( ) , pType . getActualTypeArguments ( ) ) ; handlingTypeAndParams = pType . getOwnerType ( ) ; } varMap . addAll ( getTypeVariableMap ( ) ) ; return varMap . map ( toMapType ) ; } }
maps type parameters in a type to their values .
