-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Principal check in ServletRequestMethodArgumentResolver can result in type mismatches [SPR-15214] #19779
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
Comments
Juergen Hoeller commented Like with other such assignability checks in |
Juergen Hoeller commented Like with a mismatching request argument type, we're throwing an |
Andy Wilkinson commented Was it intended that an
|
Juergen Hoeller commented Nope. I'll fix this ASAP. |
Uh oh!
There was an error while loading. Please reload this page.
George Hawkins opened SPR-15214 and commented
The
Principal
check inServletRequestMethodArgumentResolver
can result in the method returning a value that is clearly of a type that's unassignable to something ofparamType
.This gist is a JUnit test that cuts things down to a minimum and demonstrates that the
Principal
check will happily return something that is aPrincipal
subclass in the apparent belief it will be assignable to any other subclass ofPrincipal
- i.e. the same as thinking that aDouble
value will be assignable to anInteger
on the basis that both are subclasses ofNumber
.Note: just to be clear this test is expected to fail - it's demonstrating our problem case.
Affects: 4.3.6
Reference URL: https://gist.github.com/george-hawkins/3b030c04a55d03b85a99bc69228648b5
Issue Links:
Referenced from: commits e44533f, fc11321, f117b80, 6014ca9
The text was updated successfully, but these errors were encountered: