guava/src/com/google/common/reflect/TypeToken.java
@CanIgnoreReturnValue
  final TypeToken<T> rejectTypeVariables() {
    new TypeVisitor() {
      @Override
      void visitTypeVariable(TypeVariable<?> type) {
        throw new IllegalArgumentException(
            runtimeType + "contains a type variable and is not safe for the operation");
      }

      @Override
      void visitWildcardType(WildcardType type) {
        visit(type.getLowerBounds());
        visit(type.getUpperBounds());
      }

      @Override
      void visitParameterizedType(ParameterizedType type) {
        visit(type.getActualTypeArguments());
        visit(type.getOwnerType());
      }

      @Override
      void visitGenericArrayType(GenericArrayType type) {
        visit(type.getGenericComponentType());
      }
    }.visit(runtimeType);
    return this;
  }
@CanIgnoreReturnValue
  final TypeToken<T> rejectTypeVariables() {
    new TypeVisitor() {
      @Override
      void visitTypeVariable(TypeVariable<?> type) {
        throw new IllegalArgumentException(
            runtimeType + "contains a type variable and is not safe for the operation");
      }

      @Override
      void visitWildcardType(WildcardType type) {
        visit(type.getLowerBounds());
        visit(type.getUpperBounds());
      }

      @Override
      void visitParameterizedType(ParameterizedType type) {
        visit(type.getActualTypeArguments());
        visit(type.getOwnerType());
      }

      @Override
      void visitGenericArrayType(GenericArrayType type) {
        visit(type.getGenericComponentType());
      }
    }.visit(runtimeType);
    return this;
  }
@ CanIgnoreReturnValue final TypeToken < T > rejectTypeVariables ( ) { new TypeVisitor ( ) { @ Override void visitTypeVariable ( TypeVariable < ? > type ) { throw new IllegalArgumentException ( runtimeType + "contains a type variable and is not safe for the operation" ) ; } @ Override void visitWildcardType ( WildcardType type ) { visit ( type . getLowerBounds ( ) ) ; visit ( type . getUpperBounds ( ) ) ; } @ Override void visitParameterizedType ( ParameterizedType type ) { visit ( type . getActualTypeArguments ( ) ) ; visit ( type . getOwnerType ( ) ) ; } @ Override void visitGenericArrayType ( GenericArrayType type ) { visit ( type . getGenericComponentType ( ) ) ; } } . visit ( runtimeType ) ; return this ; }
Ensures that this type token doesn't contain type variables, which can cause unchecked type
errors for callers like {@link TypeToInstanceMap}.
Ensures that this type token doesn t contain type variables which can cause unchecked type errors for callers like {