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

Inject of Interfaces with Generic Type is not working

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: 3.1.0.Final
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                caristu Carlos Aristu
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: