Details
-
Type: Bug
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0-beta-3
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
According the Jon Tirsen the following should work.
MutablePicoContainer container = ...; // setup your containerDefaultComponentAdapter adapter = new DefaultComponentAdapter(null, SingleUseObject.class);SingleUseObject singleUseObject = (SingleUseObject) adapter.getComponentInstance(container);
Unfortuantly the DefaultComponentAdapter fails with a null pointer.
java.lang.NullPointerException: componentKey
at org.picocontainer.defaults.AbstractComponentAdapter.<init>(AbstractComponentAdapter.java:19)
at org.picocontainer.defaults.DefaultComponentAdapter.<init>(DefaultComponentAdapter.java:41)
at org.picocontainer.defaults.DefaultComponentAdapter.<init>(DefaultComponentAdapter.java:53)
The simple work around is to pass a key
Activity
Field | Original Value | New Value |
---|---|---|
Status | Unassigned [ 1 ] | Assigned [ 2 ] |
Assignee | Jon Tirsen [ tirsen ] |
Status | Assigned [ 2 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] |
Resolution | Fixed [ 1 ] | |
Status | Closed [ 6 ] | Reopened [ 4 ] |
Status | Reopened [ 4 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] | |
Fix Version/s | 1.0-beta-3 [ 10232 ] |
Jon, where/why did you recommend registering components with a null key? Can we close this issue?