The ImplementationHidingPC does not respect the special functionality of the used ComponentAdapterFactory, since it is caching its components in certain cases, that even might break the functionality (e.g. ThreadLocalCAF).
Test case:
public void testUsageOfADifferentComponentAdapterFactory()
{
MutablePicoContainer parent = new DefaultPicoContainer();
ImplementationHidingPicoContainer pico = new ImplementationHidingPicoContainer(new ConstructorInjectionComponentAdapterFactory(), parent);
pico.registerComponentImplementation(List.class, ArrayList.class);
List list1 = (List) pico.getComponentInstanceOfType(List.class);
List list2 = (List) pico.getComponentInstanceOfType(List.class);
assertNotNull(list1);
assertNotNull(list2);
assertFalse(list1 == list2);
}
Paul, you know, why you've added the special code ...