PicoContainer
  1. PicoContainer
  2. PICO-261

CyclicDE never thrown from DPC if a parent container exists

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2-RC1
    • Fix Version/s: 1.2
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      If a DPC has a parent container, and component instantiation would cause a CyclicDE to be thrown, it is never thrown, and the component received 'null' instead.

      Attached is a patch to fix this, but it breaks two tests:

      DPCLifeCycleTestCase.testMaliciousComponentCannotExistInAChildContainerAndSeeAnyElementOfContainerHierarchy: It only returns "<One<Two"

      DPCTestCase.testUpDownDependenciesCannotBeFollowed: It can't instantiate A because of unsatisfied dependencies

      from what I can tell, the test behavior with this patch is still "ok", but would like others to review prior to commit.

        Activity

        peter royal made changes -
        Field Original Value New Value
        Summary CyclicDE never throw from DPC if a parent container exists CyclicDE never thrown from DPC if a parent container exists
        Hide
        Jörg Schaible added a comment -

        Well, if it breaks those unit tests, it is not good. Personally I fear it is a consequence of PICO-165 ...

        Show
        Jörg Schaible added a comment - Well, if it breaks those unit tests, it is not good. Personally I fear it is a consequence of PICO-165 ...
        Hide
        peter royal added a comment -

        It is a consequence of PICO-165

        If you could still take a peek though, because from what I could tell, the "spirit" of those tests is still honored, its just manifested in a new way. I could be wrong though

        Show
        peter royal added a comment - It is a consequence of PICO-165 If you could still take a peek though, because from what I could tell, the "spirit" of those tests is still honored, its just manifested in a new way. I could be wrong though
        Hide
        Jörg Schaible added a comment -

        Applied. You were right, Pete. Looking at the modified test cases UDE would have been better before also. Aslak, can you make a test against the latest SNAPSHOT?

        Show
        Jörg Schaible added a comment - Applied. You were right, Pete. Looking at the modified test cases UDE would have been better before also. Aslak, can you make a test against the latest SNAPSHOT?
        Jörg Schaible made changes -
        Assignee Aslak Hellesoy [ rinkrank ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Aslak Hellesøy added a comment -

        I noticed the exact same bug about a month ago - null getting injected instead of a CDE thrown. I'll comment here when/if we try to upgrade to the latest snapshot.

        Show
        Aslak Hellesøy added a comment - I noticed the exact same bug about a month ago - null getting injected instead of a CDE thrown. I'll comment here when/if we try to upgrade to the latest snapshot.

          People

          • Assignee:
            Aslak Hellesøy
            Reporter:
            peter royal
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: