Skip to content
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.

JCacheManager.unwrap #20

Closed
Mobe91 opened this issue Apr 11, 2014 · 1 comment
Closed

JCacheManager.unwrap #20

Mobe91 opened this issue Apr 11, 2014 · 1 comment
Assignees
Labels
Milestone

Comments

@Mobe91
Copy link

Mobe91 commented Apr 11, 2014

Hi, I think someone forgot to return the casted cacheManager.
So instead of

@Override
    public <T> T unwrap(final Class<T> clazz) {
        if(clazz.isAssignableFrom(getClass())) {
            return clazz.cast(this);
        }
        if(clazz.isAssignableFrom(cacheManager.getClass())) {
            clazz.cast(cacheManager);
        }
        throw new IllegalArgumentException();
    }

it should be

@Override
    public <T> T unwrap(final Class<T> clazz) {
        if(clazz.isAssignableFrom(getClass())) {
            return clazz.cast(this);
        }
        if(clazz.isAssignableFrom(cacheManager.getClass())) {
            return clazz.cast(cacheManager);
        }
        throw new IllegalArgumentException();
    }

Or am I missing something?

@alexsnaps alexsnaps self-assigned this Apr 11, 2014
@alexsnaps alexsnaps added this to the 1.0.0 milestone Apr 11, 2014
@alexsnaps
Copy link
Member

Oh yes! Who would have thought the TCK wouldn't catch that ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants