Re: [picocontainer-dev] PicoContainer.getComponentAdapter(Class<T> componentType, ParameterName componentParameterName) - Bug?

Paul Hammant <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
I'm pretty sure that it should barf during the first addComponent(..)

  - MyStartable is not assignable from Map

- Paul

On Nov 17, 2007, at 8:49 AM, Konstantin Priblouda wrote:

>
> --- Paul Hammant <[email protected]> wrote:
>
>> I'm not getting it from that description Konstantin,
>> can you
>> elaborate or show us a testcase ?
>
> In my perception  his should work properly:
>
> ----------------%<------------
>     /**
>      * while resolving component by type, only
> components
>      * of those type shall be retuned.
>      *
>      */
>     public void testThatByTypeResolutionIsHonored() {
>     	MutablePicoContainer container =
> createPicoContainer(null);
>
> container.addComponent(Map.class,MyStartable.class);
>     	container.addComponent("glumBlam",HashMap.class);
>     	
>
> assertSame(container.getComponent("glumBlam"),container.getComponent 
> (Map.class));
>     }
> --------------%<-----------
> ( paste to DPCTC )
>
> This fails even before I retrieval - AbstractAdapter
> requires  that added component whall be subclass
> ( assignbable to ) of instance of key ( in case key is
> a class )  -
>
> Is this bug or feature?  No doc on MPC states this.
>
> Once this is fixed, I'm pretty sure that  comparison
> will fail... ( due to retrieval of wrong component )
>
>
>
> ----[ Konstantin Pribluda http://www.pribluda.de ]----------------
> JTec quality components: http://www.pribluda.de/projects/
>
>
>        
> ______________________________________________________________________ 
> ______________
> Be a better sports nut!  Let your teams follow you
> with Yahoo Mobile. Try it now.  http://mobile.yahoo.com/ 
> sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.