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

Treat null path as non-matching pattern in AntPathMatcher #23297

Closed
wants to merge 1 commit into from
Closed

Conversation

rs017991
Copy link
Contributor

@rs017991 rs017991 commented Jul 16, 2019

This PR supersedes gh-943.

I noticed that the MVC Test redirectedUrl matcher fails with a NullPointerException if there happens to be no "Redirected URL" on the response (the test should still fail, but with a proper assertion error).

One way to fix this would be to assertNotNull in the respective MockMvcResultMatchers method before calling the AntPathMatcher, but I thought it would be more appropriate to fix the underlying null-safety issues. You may disagree.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 16, 2019
@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) in: test Issues in the test module type: enhancement A general enhancement labels Jul 16, 2019
@sbrannen sbrannen changed the title Fixed NPEs in AntPathMatcher Avoid NullPointerExceptions in AntPathMatcher Jul 16, 2019
@sbrannen sbrannen self-assigned this Jul 16, 2019
@sbrannen sbrannen removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 16, 2019
@sbrannen sbrannen added this to the 5.2 RC1 milestone Jul 16, 2019
sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Jul 17, 2019
@sbrannen sbrannen changed the title Avoid NullPointerExceptions in AntPathMatcher Treat null path as non-matching pattern in AntPathMatcher Jul 17, 2019
@sbrannen sbrannen closed this in 84200f3 Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) in: test Issues in the test module type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants