Details
-
Type: Improvement
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0-beta-5
-
Component/s: PicoContainer (Java)
-
Labels:None
-
Number of attachments :
Description
Given a class:
public class Dependency {
public Dependency(int x) {
}
public Dependency(String value) {
}
public Dependency(String value, int x) {
}
}
then in main():
pico.registerComponentImplementation("x", Dependency.class);
pico.getComponentInstance(Dependency.class);
The original unsatisfied dependency set contains the parameter that failed in ConstructorComponentAdapter.getAllSatisfiableConstructors.
This yields this output on a org.picocontainer.defaults.UnsatisfiableDependenciesException:
Unsatisfiable dependencies: [int, class java.lang.String]
After my diff, it reports the complete constructor parameter list as a List:
Unsatisfiable dependencies: [[int], [class java.lang.String], [class java.lang.String, int]]
Which makes it clearer as to what fails.
The proper output depends on Joerg Schaible's patch in PICO-131. Without that, ArrayIndexOutOfBoundsException happens. Please ignore my diffs posted in PICO-131.
Activity
Field | Original Value | New Value |
---|---|---|
Attachment | ParameterList.diff [ 11399 ] |
Resolution | Fixed [ 1 ] | |
Fix Version/s | 1.0-beta-5 [ 10145 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Patch against the source and test case.