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

ClassCastException in ResponseBodyEmitterReturnValueHandler.supportsReturnType(…) [SPR-12693] #17291

Closed
spring-issuemaster opened this issue Feb 5, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Feb 5, 2015

Oliver Drotbohm opened SPR-12693 and commented

ResponseBodyEmitterReturnValueHandler.supportsReturnType(…) casts a previously looked up type argument to cast and thus will cause a ClassCastException in case the type argument is a parameterized in turn (e.g. using ResponseEntity<SomeParameterizedType<?>>).

ParameterizedType type = (ParameterizedType) paramType;
Type[] typeArguments = type.getActualTypeArguments();
if (typeArguments.length == 1) {
	return ResponseBodyEmitter.class.isAssignableFrom((Class<?>) typeArguments[0]);
}

No further details from SPR-12693

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.