Details
-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.0
-
Component/s: PicoContainer (Java)
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
The following test case will fail on any container based on AbstractDelegatingPicoContainer:
@Test public void testAsPropagatesForExactlyOneInvocation() { MutablePicoContainer mpc = createPicoContainer(null); mpc.change(Characteristics.CACHE); mpc .as(Characteristics.CACHE).addComponent("bufferTwo", StringBuffer.class, DefaultConstructorParameter.INSTANCE) .as(Characteristics.NO_CACHE).addComponent("bufferOne", StringBuffer.class, DefaultConstructorParameter.INSTANCE) .addComponent("bufferThree", StringBuffer.class, DefaultConstructorParameter.INSTANCE); assertNotSame(mpc.getComponent("bufferOne"), mpc.getComponent("bufferOne")); assertSame(mpc.getComponent("bufferTwo"), mpc.getComponent("bufferTwo")); //Default behavior is caching. assertSame(mpc.getComponent("bufferThree"), mpc.getComponent("bufferThree")); }
Fixed with checkin on 5/31, hash: 14bf04147ad3b06d83c1e7504dcb31c7497f0c1e