Skip to content

URIComponentsBuilder should not clear query parameters in method designed for adding #35628

@hosea

Description

@hosea

I observed that UriComponentsBuilder#query unexpectedly clears all existing query parameters, when passing "null" as argument. In this case the method behaves like UriComponentsBuilder#replaceQuery that clearly should clear all query parameters when "null" is passed.

The semantic of UriComponentsBuilder#query is unclear: intentionally this method is build for adding query parameters, not for clearing / removing. But it can also be used for clearing all parameters as UriComponentsBuilder#replaceQuery when passing "null".

The path inside the method that executes "queryParams.clear()" should be a noop in my opinion.

PR added as proposal: #35629

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: supersededAn issue that has been superseded by anothertype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions