Skip to content

Accept @Nullable contextPath in ServerHttpRequest.Builder - #37150

Closed
yashsiwacha wants to merge 1 commit into
spring-projects:mainfrom
yashsiwacha:fix/issue-37098-nullable-context-path-builder
Closed

Accept @Nullable contextPath in ServerHttpRequest.Builder#37150
yashsiwacha wants to merge 1 commit into
spring-projects:mainfrom
yashsiwacha:fix/issue-37098-nullable-context-path-builder

Conversation

@yashsiwacha

@yashsiwacha yashsiwacha commented Aug 18, 2026

Copy link
Copy Markdown

Mark the contextPath parameter as @Nullable in both the ServerHttpRequest.Builder interface and DefaultServerHttpRequestBuilder implementation.

Previously, although DefaultServerHttpRequestBuilder handled null values internally (e.g., in MutatedServerHttpRequest and DefaultRequestPath.initContextPath()), the public interface lacked the @Nullable annotation. In a @NullMarked package, this caused compile-time validation issues (such as under NullAway) for callers trying to pass null to reset/clear the context path.

Closes gh-37098

Mark the contextPath parameter as @nullable in both the ServerHttpRequest.Builder
interface and DefaultServerHttpRequestBuilder implementation.

Previously, although DefaultServerHttpRequestBuilder handled null values internally
(e.g., in MutatedServerHttpRequest and DefaultRequestPath.initContextPath()),
the public interface lacked the @nullable annotation. In a @NullMarked package,
this caused compile-time validation issues (such as under NullAway) for callers
trying to pass null to reset/clear the context path.

Closes spring-projectsgh-37098

Signed-off-by: Yash Siwach <yashsiwach07@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 18, 2026
@sbrannen sbrannen added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Aug 19, 2026
@sbrannen

Copy link
Copy Markdown
Member

Closing as a duplicate of:

In the future, please:

  1. First ask the team if a PR is desired by commenting on the related issue.
  2. Ensure there are no competing PRs before submitting a duplicate.

Thanks

@sbrannen sbrannen closed this Aug 19, 2026
@sbrannen sbrannen added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ServerHttpRequest.Builder.contextPath() does not accept null but the implementation is nullable

3 participants