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

Avoid unnecessary Map wrapping in DefaultPathSegment #27063

Closed

Conversation

Dunemaster
Copy link

Avoid creating unnessary wrapper for empty map in DefaultPathSegment

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 15, 2021
@sbrannen sbrannen self-assigned this Jun 15, 2021
@sbrannen sbrannen added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Jun 15, 2021
@sbrannen sbrannen changed the title Avoid unessary wrappings Avoid unnecessary Map wrapping in DefaultPathSegment Jun 15, 2021
@sbrannen sbrannen added this to the 5.3.9 milestone Jun 15, 2021
@sbrannen sbrannen added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 15, 2021
@sbrannen sbrannen changed the title Avoid unnecessary Map wrapping in DefaultPathSegment DefaultPathSegment allows shared empty map to be mutated Jun 15, 2021
@sbrannen
Copy link
Member

sbrannen commented Jun 15, 2021

Thanks for the PR!

It turns out that your proposal introduces a bug, which in turn made me notice an existing bug.

Namely, any map returned by PathSegment#parameters() must be immutable, and this includes the shared empty map (EMPTY_PARAMS).

@sbrannen sbrannen marked this pull request as draft June 15, 2021 12:37
@sbrannen sbrannen removed this from the 5.3.9 milestone Jun 15, 2021
@sbrannen sbrannen added status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement status: superseded An issue that has been superseded by another and removed type: bug A general bug labels Jun 15, 2021
@sbrannen
Copy link
Member

Superseded by #27064

@sbrannen sbrannen closed this Jun 15, 2021
@sbrannen sbrannen changed the title DefaultPathSegment allows shared empty map to be mutated Avoid unnecessary Map wrapping in DefaultPathSegment Jun 15, 2021
@snicoll snicoll removed the status: superseded An issue that has been superseded by another label Jun 15, 2021
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: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants