-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
Collaborator
Issue body actions
George Shan Lyons opened SPR-11885 and commented
In previous versions, the following was possible:
final UriComponentsBuilder commonUri = UriComponentsBuilder.fromHttpUrl("http://thing.com").pathSegment("/somePath");
UriComponents url1 = commonUri.build();
UriComponents url2 = commonUri.pathSegment("additionalPath").build();
Unfortunately, the state is now internally shared, I believe through a List of PathComponentBuilders, such that the change to the builder in url2 affects url1. The expectation is that, once build is called, the UriComponents instance is no longer mutable through the builder.
Workaround is simple, just create 2 builders.
Affects: 3.2.8
Issue Links:
- UriComponentsBuilder and ServletUriComponentsBuilder generate URLs with empty segments [SPR-10270] #14904 UriComponentsBuilder and ServletUriComponentsBuilder generate URLs with empty segments
Referenced from: commits 247771c, d239016, c73ac07
Backported to: 3.2.10
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Type
Projects
Relationships
Development
Select code repository
Activity
spring-projects-issues commentedon Jun 24, 2014
Juergen Hoeller commented
George, which release have you been using this with before? Any idea when that regression was introduced?
Juergen
spring-projects-issues commentedon Jun 24, 2014
George Shan Lyons commented
We were using Spring 3.1.2 previously. I am currently at work, but would be happy to help narrow this down further.
-Shan
spring-projects-issues commentedon Jun 24, 2014
George Shan Lyons commented
Working in Spring 3.2.1.RELEASE. Broken in Spring 3.2.2.RELEASE.
spring-projects-issues commentedon Jun 25, 2014
Juergen Hoeller commented
This seems to be a side effect of #14904... As we didn't have any tests for such multiple independent build() calls on the same builder instance, we unfortunately didn't notice.
Anyway, fixed for 4.1 now and to be backported to 4.0.6 and 3.2.10.
Juergen
spring-projects-issues commentedon Jun 25, 2014
George Shan Lyons commented
Thank you very much!