private <T> Key<T> assistKey(Method method, Key<T> key, Errors errors) throws ErrorsException {
    if (key.getAnnotationType() == null) {
      return Key.get(key.getTypeLiteral(), DEFAULT_ANNOTATION);
    } else if (key.getAnnotationType() == Assisted.class) {
      return key;
    } else {
      errors.withSource(method).addMessage(PrettyPrinter.format(
          "Only @Assisted is allowed for factory parameters, but found @%s",
          key.getAnnotationType()));
      throw errors.toException();
    }
  }
private < T > Key < T > assistKey ( Method method , Key < T > key , Errors errors ) throws ErrorsException { if ( key . getAnnotationType ( ) == null ) { return Key . get ( key . getTypeLiteral ( ) , DEFAULT_ANNOTATION ) ; } else if ( key . getAnnotationType ( ) == Assisted . class ) { return key ; } else { errors . withSource ( method ) . addMessage ( PrettyPrinter . format ( "Only @Assisted is allowed for factory parameters, but found @%s" , key . getAnnotationType ( ) ) ) ; throw errors . toException ( ) ; } }
Returns a key similar to {@code key}, but with an {@literal @}Assisted
binding annotation.

This fails if another binding annotation is clobbered in the process. If
the key already has the {@literal @}Assisted annotation, it is returned
as-is to preserve any String value.