Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
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 :
Description
A ConstantParameter instanciates a InstanceComponentAdapter with
the value itself as key and registers it in the pico. This is
critical if the value of the parameter equals a key of a component.
Verifying the container throws then a TooManySatisfiableConstructorsException.
In worst case scenario, the value could have been configured by an
admin breaking the application by chance.
To solve the problem create unique keys for adapters holding
constant parameters, allow a null value as key or remove the key at
all as proposed in PICO-105, since it is not used anyway in this
context.
Activity

Field | Original Value | New Value |
---|---|---|
Attachment | ParameterTestCase.java.diff [ 11330 ] |

Fix Version/s | 1.0-beta-5 [ 10145 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] | |
Assignee | Aslak Hellesoy [ rinkrank ] |

Status | Closed [ 6 ] | Reopened [ 4 ] |
Resolution | Fixed [ 1 ] |

Attachment | ParameterTestCase.java.diff [ 11454 ] |

Attachment | ConstantParameter.java.diff [ 11455 ] |

Status | Reopened [ 4 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] |
src\test\org\picocontainer\defaults\ParameterTestCase.java.diff
Patch to add a fixture for paarmeter test case, that demonstrates the bug.