tags:

views:

56

answers:

1

I have a method declared as below

<T> T getAdapter(Adaptable adaptable, Class<T> extensionInterface);

and I'm calling it with below argumants

adapterManager.getAdapter(new AWScoreAdapterImpl(null), AWScoreAdapter.class);

Can someone help me understand why the above line is causing the below compile time error

The method getAdapter(Adaptable, Class) in the type AdapterManager is not applicable for the arguments (AWScoreAdapterImpl, Class)

+4  A: 

It's nothing to do with generics - your AWScoreAdapterImpl isn't of type Adaptable. Either implement its interface, or extend it if it's a class.

Are you able to post your class definitions here? In particular, Adaptable, AWScoreAdapterImpl and AdapterManager.

Noel M
yep thats true...learning too much of generics and it is always the first suspect ;-)
Pangea