Details
Description
I've a PicoContainer instance of the type AspectablePicoContainer (just call it parentContainer here) of which I'd like to spawn a child container of the same type using .makeChildContainer().
The javadocs of PicoContainer.makeChildContainer() reads: "Make a child container, using the same implementation of MutablePicoContainer as the parent." so I think the spawned child-container should be of the parent-container's type. But unfortunately the created child container is just a regular DefaultPicoContainer by its type.
Just use the following code to check
AspectablePicoContainer parentContainer = ..... // get from somewhere
MutablePicoContainer childContainer = parentContainer.makeChildContainer();
parentContainer.addChildContainer(childContainer);
System.out.println((parentContainer instanceof AspectablePicoContainer)); //
= true
System.out.println((childContainer instanceof AspectablePicoContainer)); // =
false
Issue Links
- is related to
-
NANO-137 Groovy Builder for Nano does not propate parent container types or component adapters.
Activity
Environment |
OS: Linux 2.6.8-24.11-default Java: 1.4.2_06 (Sun) |
OS: Linux 2.6.8-24.11-default Java: 1.4.2_06 (Sun) |
Fix Version/s | 1.0-RC2 [ 11851 ] | |
Description |
I've a PicoContainer instance of the type AspectablePicoContainer (just call it parentContainer here) of which I'd like to spawn a child container of the same type using .makeChildContainer(). The javadocs of PicoContainer.makeChildContainer() reads: "Make a child container, using the same implementation of MutablePicoContainer as the parent." so I think the spawned child-container should be of the parent-container's type. But unfortunately the created child container is just a regular DefaultPicoContainer by its type. Just use the following code to check AspectablePicoContainer parentContainer = ..... // get from somewhere MutablePicoContainer childContainer = parentContainer.makeChildContainer(); parentContainer.addChildContainer(childContainer); System.out.println((parentContainer instanceof AspectablePicoContainer)); // = true System.out.println((childContainer instanceof AspectablePicoContainer)); // = false |
I've a PicoContainer instance of the type AspectablePicoContainer (just call it parentContainer here) of which I'd like to spawn a child container of the same type using .makeChildContainer(). The javadocs of PicoContainer.makeChildContainer() reads: "Make a child container, using the same implementation of MutablePicoContainer as the parent." so I think the spawned child-container should be of the parent-container's type. But unfortunately the created child container is just a regular DefaultPicoContainer by its type. Just use the following code to check AspectablePicoContainer parentContainer = ..... // get from somewhere MutablePicoContainer childContainer = parentContainer.makeChildContainer(); parentContainer.addChildContainer(childContainer); System.out.println((parentContainer instanceof AspectablePicoContainer)); // = true System.out.println((childContainer instanceof AspectablePicoContainer)); // = false |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Although for a different container ...