[picocontainer-dev] Ambiguity resolution?
Konstantin Priblouda <kpriblouda-/[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
I'm bit of confused in ambiguity resolution.
Well, if components ( integers ) are on the
same level there is ambiguity. But not if they
are on different levels. IMHO, NeedsTwo shall not be
resolved in this case - "bar" does not mask "foo", and
will be returned too if asked for collection of
integers.
Here is testcase ( in DPCT ):
public void testThatAmbiguityIsResolvedProperly()
{
MutablePicoContainer parent =
createPicoContainer(null);
MutablePicoContainer child =
createPicoContainer(parent);
parent.addComponent("foo",new Integer(239));
child.addComponent("bar",new Integer(555));
child.addComponent(NeedsTwo.class);
assertEquals(new
Integer(555),child.getComponent(Integer.class));
assertEquals("bar",child.getComponentAdapter(Integer.class,null).getComponentKey());
assertNotNull(child.getComponent(NeedsTwo.class));
}
WDYT?
----[ Konstantin Pribluda http://www.pribluda.de ]----------------
JTec quality components: http://www.pribluda.de/projects/
____________________________________________________________________________________
Get easy, one-click access to your favorites.
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email