Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixed nullity discreapency between documenation and assert check in R... #18076

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

Open
ronodhirSoumik wants to merge 1 commit into spring-projects:main
base: main
Choose a base branch
Loading
from ronodhirSoumik:bugfix/fixed-nullity-documentation-mismatch-regexRequestMatcher

Conversation

@ronodhirSoumik
Copy link
Contributor

@ronodhirSoumik ronodhirSoumik commented Oct 19, 2025
edited by jzheaux
Loading

Related to #18069

@ronodhirSoumik ronodhirSoumik force-pushed the bugfix/fixed-nullity-documentation-mismatch-regexRequestMatcher branch from c2b6652 to 6975c70 Compare October 19, 2025 20:57
Copy link
Contributor

@jzheaux jzheaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @ronodhirSoumik! Thanks for this cleanup. I've left some feedback inline.

/**
* Creates a case-sensitive {@code Pattern} instance to match against the request.
* @param method the HTTP method to match. May be null to match all methods.
* @param method the HTTP method to match. May not be null to match all methods.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May not be null to match all methods.

This sentence now sounds a little cryptic. Can we simply leave it out? Folks can call another static method if they only care about the URI.

Copy link

@edudar-chwy edudar-chwy Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While Javadoc can be improved, I don't see a good reason to restrict input value here artificiallly. Constructor already takes care of the null case; throughout the class httpMethod is assumed to be nullable. Just let it be null. A sibling PathPatternRequestMatcher, for example, allows method as null, explicitly marking it as @Nullable. While it would be good to get rid of nullable all together, HttpMethod does not have an "any/all" option.

Ideally, a builder similar to one in PathPatternRequestMatcher would do a good job here. Meanwhile, I'm just using constructor, because I get the method as an input myself, so checking null and deciding between faactory methods is much more verbose then just calling a constructor.

ronodhirSoumik reacted with thumbs up emoji
Copy link
Contributor Author

@ronodhirSoumik ronodhirSoumik Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am undoing the change in javadoc and removing the Assert.notNull(method, "method cannot be null"); - hope that do as a minimal change

Copy link
Contributor

jzheaux commented Oct 20, 2025

Also, @ronodhirSoumik, will you please reference #18069 in your commit message. Something like this:

Correct JavaDoc about HttpMethod Parameter
Closes gh-18069
ronodhirSoumik reacted with thumbs up emoji

@ronodhirSoumik ronodhirSoumik force-pushed the bugfix/fixed-nullity-documentation-mismatch-regexRequestMatcher branch 2 times, most recently from bb27474 to 1ee78dd Compare October 24, 2025 06:34
@ronodhirSoumik ronodhirSoumik force-pushed the bugfix/fixed-nullity-documentation-mismatch-regexRequestMatcher branch from 1ee78dd to b6b23d8 Compare October 24, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jzheaux jzheaux jzheaux requested changes

+1 more reviewer

@edudar-chwy edudar-chwy edudar-chwy left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /