It just looks like a belayed cast to me.
----- Original Message -----
From: "Niclas Hedhman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 28, 2004 9:56 AM
Subject: Re: Java 1.5, fun with lookups and generics
> Leo Sutic said:
> > we all hate the:
> >
> > MyComponent comp = (MyComponent) lookup (MyComponent.ROLE);
>
> > ServiceManager sm = new DefaultServiceManager();
> > A a = sm.<A>lookup ("A");
>
> MyComponent comp = sm.<MyComponent>lookup( "MyComponent" );
>
>
> And that would be compile time checkable???
>
> The construct, IMHO, does not look any "nicer", so it'd better be
> compile time type safe... (even though I fail to see how :o( )
>
> Niclas
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]