Details
-
Type: Bug
-
Status: Closed
-
Priority: Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0-beta-4
-
Component/s: PicoContainer (Java)
-
Labels:None
-
Number of attachments :
Description
the current container hierachy model doesn't support removing a child containers from a parent since getChildContainers() returns Collections.unmodifiableCollection(children);
this is big problem when u are using containers for different scopes and one scope ends.
eg. [servlet enviroment - MPC = MutablePicoContainer]
MPC sessionPico = (MPC)session.getAttribute(KEY);
MPC requestPico = createMPC();
requestPico.addParent(sessionPico);
request.setAttribute(KEY, requestPico);
once the request is done requestPico should be removed but u can't. the result is an ever growing collection of picos + the object instances attached to them.
in addition to that i think a call to addParent(...) shouldn't internally call parent.addChild(...) since this forces 2 ways relationships which might not be appropriate in some cases.
Activity
Field | Original Value | New Value |
---|---|---|
Status | Unassigned [ 1 ] | Assigned [ 2 ] |
Assignee | Aslak Hellesoy [ rinkrank ] |
Fix Version/s | 1.0 [ 10145 ] | |
Status | Assigned [ 2 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] |
Resolution | Fixed [ 1 ] | |
Status | Closed [ 6 ] | Reopened [ 4 ] |
Fix Version/s | 1.0-beta-4 [ 10412 ] | |
Status | Reopened [ 4 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] | |
Fix Version/s | 1.0 [ 10145 ] |
I second this.