[webbeans-dev] Re: producer methods and injection

Gavin King gavin at hibernate.org
Wed Dec 31 23:53:10 EST 2008


That code should work. If it doesn't it would be a bug.

On Wed, Dec 31, 2008 at 9:38 PM, Nicklas Karlsson <nickarls at gmail.com> wrote:
> Hi,
>
> Is there something I don't understand about producers methods and
> injection with parameterized types when I have
>
> public class A
> {
>   @Produces @Users
>   public List<User> getUsers() {
>      List<User> users = new ArrayList<User>();
>      users.add(new User("1", "1", "1"));
>      return users;
>   }
> }
>
> and
>
> @SessionScoped
> public class B
> {
>   @Users
>   private List<User> users;
>
>   public int count() {
>      return users.size();
>   }
> }
>
> When B is created and injection is done, it goes looking for
> java.util.List and fails.
>
> ---
> Nik
>



-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org



More information about the weld-dev mailing list