Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1976

All ResourceProvider#canProvide implementations could try to inject subtypes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.1.9.Final
    • None
    • None
    • None

    Description

      Currently the conditions seem to be the other way round as they normally would:

          @Override
          public boolean canProvide(Class<?> type)
          {
      -      return Deployer.class.isAssignableFrom(type);
      +      return type.isAssignableFrom(Deployer.class);
          }
      

      It does not seem to be intentional. This would not be usually spotted because usually the same class is injected and requested and no provider provides a subtype of other ResourceProvider, so the problem would never occur.

      The resulting exception would look like:

      java.lang.RuntimeException: Could not set value on field protected ClassA TestClass.field using ClassB@19b89d4, 
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            rhn-engineering-rhusar Radoslav Husar
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: