users@hk2.java.net

Re: TypeLiteral and _at_ContractsProvided

From: John Wells <john.wells_at_oracle.com>
Date: Wed, 28 May 2014 05:53:24 -0400

It is possible that this is true. Could you enter a Jira on this issue?
(https://java.net/jira/browse/HK2)

Thanks!

On 5/27/2014 12:48 AM, buko wrote:
>
> Seems like there's a bug with addActiveDescriptor and
> ContractsProvided. If you use it on a generic interface it doesn't
> actually seem to detect that one of the contracts is a generic
> interface and bind it appropriately so attempts to @Inject the binding
> later fails. If you normally bind it, using the TypeLiteral syntax
> (bind(A).to(new TypeLiteral<B<C>>)) ... then attempts to inject B<C>
> will work.
>
> Seems like ContractsProvided ought to handle this?