Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change <T> T get(String key) to allow direct Casting. #9

Merged
merged 1 commit into from
Sep 25, 2015
Merged

Change <T> T get(String key) to allow direct Casting. #9

merged 1 commit into from
Sep 25, 2015

Conversation

alorma
Copy link
Contributor

@alorma alorma commented Sep 24, 2015

This will make a ClassCastException if you pass an Object type that is not correct.

Review on Reviewable

This will make a ClassCastException if you pass an Object type that is not correct.
@alorma alorma changed the title Change <T> T get(String key) to allow direct Casting. Change <T> T get(String key) to allow direct Casting. Sep 24, 2015
@rocboronat
Copy link
Member

Wep! Just realized that the code that tests that the casting is OK and the casting is bad is different.

To test that it breaks:
ObjectTestTwo testTwo = (ObjectTestTwo) cache.get(A_KEY);

To test that it's OK:
ObjectTestOne objectTestOne = cache.get(A_KEY);

Can we test the two ways to get an OK and a KO?

@rocboronat
Copy link
Member

Yep! I'll do it :·P

rocboronat added a commit that referenced this pull request Sep 25, 2015
Change <T> T get(String key) to allow direct Casting.
@rocboronat rocboronat merged commit f2d5cc9 into fewlaps:master Sep 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants