PicoContainer
  1. PicoContainer
  2. PICO-131

Honor given parameter types instantiating components

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-beta-5
    • Fix Version/s: 1.0-beta-5
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Number of attachments :
      5

      Description

      Current implementation of ConstructingComponentAdapter will always select the ctor with the highest arity of a component. This strategy ignores completely if a user has provided parameters at the component registration.

      The number of parameters and their type should be honored selecting the best ctor of a component.

      1. AbstractMultipleConstructorTestCase.java.diff
        3 kB
        Jörg Schaible
      2. ConstructorComponentAdapter.java.diff
        6 kB
        Miguel Paraz
      3. ConstructorComponentAdapter.java.diff
        4 kB
        Jörg Schaible
      4. ParameterListUpdatedTestCase.diff
        34 kB
        Miguel Paraz
      5. ParameterListUpdatedTestCase2.diff
        6 kB
        Miguel Paraz

        Issue Links

          Activity

          Hide
          Jörg Schaible added a comment -

          src/java/org/picocontainer/defaults/ConstructorComponentAdapter.java

          Implementation for a ctor selcetion honoring given number of parameters and their type.

          Fixes additionally PICO-121
          (See the single line change in getAllSatisfiableConstructors)

          Show
          Jörg Schaible added a comment - src/java/org/picocontainer/defaults/ConstructorComponentAdapter.java Implementation for a ctor selcetion honoring given number of parameters and their type. Fixes additionally PICO-121 (See the single line change in getAllSatisfiableConstructors)
          Jörg Schaible made changes -
          Field Original Value New Value
          Attachment ConstructorComponentAdapter.java.diff [ 11381 ]
          Hide
          Jörg Schaible added a comment -

          src/test/org/picocontainer/tck/AbstractMultipleConstructorTestCase.java

          Patch: Add test fixture for new functionality.

          Show
          Jörg Schaible added a comment - src/test/org/picocontainer/tck/AbstractMultipleConstructorTestCase.java Patch: Add test fixture for new functionality.
          Jörg Schaible made changes -
          Hide
          Miguel Paraz added a comment -

          Great work, Joerg! I thought it would be more descriptive to list the entire constructor parameter list, and not just the parameter that didn't match. Here's a small update to your patch.

          Show
          Miguel Paraz added a comment - Great work, Joerg! I thought it would be more descriptive to list the entire constructor parameter list, and not just the parameter that didn't match. Here's a small update to your patch.
          Miguel Paraz made changes -
          Hide
          Miguel Paraz added a comment -

          ParameterListUpdatedTestCase.diff updates the test cases to account for my new unsatisfiable dependency reporting.

          (Sorry but Eclipse seems to generating a larger diff than necessary.)

          Show
          Miguel Paraz added a comment - ParameterListUpdatedTestCase.diff updates the test cases to account for my new unsatisfiable dependency reporting. (Sorry but Eclipse seems to generating a larger diff than necessary.)
          Miguel Paraz made changes -
          Attachment ParameterListUpdatedTestCase.diff [ 11397 ]
          Hide
          Miguel Paraz added a comment -

          Here's a brief, descriptive version of ParameterListUpdatedTestCase.diff. Comments in the mailing list.

          Show
          Miguel Paraz added a comment - Here's a brief, descriptive version of ParameterListUpdatedTestCase.diff. Comments in the mailing list.
          Miguel Paraz made changes -
          Attachment ParameterListUpdatedTestCase2.diff [ 11398 ]
          Hide
          Jörg Schaible added a comment -

          Hello Aslak,

          just a word to clear the status of the attachments to this issue:

          You've already applied the patches from Miguel with PICO-134, so you can just use the two original patches with the date from 9th February.

          Regards,
          Jörg

          Show
          Jörg Schaible added a comment - Hello Aslak, just a word to clear the status of the attachments to this issue: You've already applied the patches from Miguel with PICO-134 , so you can just use the two original patches with the date from 9th February. Regards, Jörg
          Aslak Hellesøy made changes -
          Link This issue duplicates PICO-121 [ PICO-121 ]
          Aslak Hellesøy made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          Assignee Aslak Hellesoy [ rinkrank ]
          Fix Version/s 1.0-beta-5 [ 10145 ]

            People

            • Assignee:
              Aslak Hellesøy
              Reporter:
              Jörg Schaible
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 20 minutes
                20m
                Remaining:
                Remaining Estimate - 20 minutes
                20m
                Logged:
                Time Spent - Not Specified
                Not Specified