PicoContainer
  1. PicoContainer
  2. PICO-379

ReflectionLifecycleStrategy should support "null" methods

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Environment:
      Affects 2.12, which is not available here.
    • Patch Submitted:
      Yes
    • Number of attachments :
      2

      Description

      I want to support a legacy lifecycle pattern in our code where we only have one init() method, no stop/dispose methods. Ideally I guess I should be able to use this lifecycle strategy:
      new ReflectionLifecycleStrategy(componentMonitor, "init", null, null)
      but this fails miserably with NPEs in java.lang.Class.

      The attached patch allows this, thus keeping me from having to do
      new ReflectionLifecycleStrategy(componentMonitor, "init", "some-really-stupid-method-name-that-won't-exist", "some-really-stupid-method-name-that-won't-exist-either")

        People

        • Assignee:
          Unassigned
          Reporter:
          Grégory Joseph
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: