Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2575

Inject of Interfaces with Generic Type is not working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 3.1.0.Final
    • None
    • None

    Description

      Let's suppose that I have the following interface:

      public interface MyInterface<T> {
      }
      

      And the following injection point:

      public class MyClassWithInjectionPoint<T> {
        ...
        @Inject
        @Any
        private Instance<MyInterface<T>> injectedInstances;
        ...
      } 
      

      Then no instances of classes implementing A are injected, I need to use wildcards to make it work:

      public class MyClassWithInjectionPoint<T> {
        ...
        @Inject
        @Any
        private Instance<MyInterface<?>> injectedInstances;
      }
      

      Is this the expected behavior?

      Note: I have detected this problem after upgrading the Weld version I use from 1.1.24 to 3.1.0. In 1.1.24 this was working fine for me.

      Attachments

        Activity

          People

            Unassigned Unassigned
            caristu Carlos Aristu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: