JCLOUDS-303. unwrap should permit subtypes

This commit is contained in:
Adrian Cole 2013-09-27 14:25:32 -07:00
parent bd984ba508
commit 9f12b6309d
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ public abstract class BaseView extends ForwardingObject implements View {
public <A extends Closeable> A unwrapApi(Class<A> apiClass) {
checkArgument(ApiContext.class.isAssignableFrom(backendType.getRawType()),
"backend type: %s should be an ApiContext", backendType);
TypeToken<ApiContext<A>> contextToken = new TypeToken<ApiContext<A>>(delegate().getClass()) {
TypeToken<ApiContext<? extends A>> contextToken = new TypeToken<ApiContext<? extends A>>(delegate().getClass()) {
private static final long serialVersionUID = 1L;
}.where(new TypeParameter<A>() {
}, TypeToken.of(apiClass));