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)
It’s nothing to do with generics – your
AWScoreAdapterImplisn’t of typeAdaptable. Either implement its interface, or extend it if it’s a class.Are you able to post your class definitions here? In particular,
Adaptable,AWScoreAdapterImplandAdapterManager.