PicoContainer
  1. PicoContainer
  2. PICO-369

generic signature of ComponentAdapter#getComponentImplementation

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.10.1
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Number of attachments :
      0

      Description

      The signature of method ComponentAdapter#getComponentImplementation is currently

      Class<T> getComponentImplementation();

      To me it feels like

      Class<? extends T> getComponentImplementation();

      should be used instead, in order to allow (eg) for

      public class MyAdapter implements ComponentAdapter<List> {

      private Class<? extends List> implementationclass = ArrayList.class;

      public Class<? extends List> getComponentImplementation()

      { return implementationclass; }

      // ...
      }

      (the above is adapted from a real case I got into while integrating pico with stripes - I want to implement an adapter which resolves to whatever ActionBeanContext class is configured in web.xml and so there is no way I can statically type the T of ComponentAdapter)

        People

        • Assignee:
          Paul Hammant
          Reporter:
          Giorgio Gallo
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: