Skip to content

Conversation

ronodhirSoumik
Copy link
Contributor

@ronodhirSoumik ronodhirSoumik commented Oct 19, 2025

Related to #18069

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 19, 2025
@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.

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.

Copy link
Contributor Author

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

@jzheaux
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants