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

InterceptingHttpAccessor.setInterceptors should support immutable lists [SPR-16137] #20685

spring-projects-issues opened this issue Oct 31, 2017 · 1 comment
in: web type: regression


Copy link

@spring-projects-issues spring-projects-issues commented Oct 31, 2017

Joakim Lindberg opened SPR-16137 and commented

When upgrading from org.springframework:spring-web:4.2.4.RELEASE our httpinterceptors stopped working because we used immutable list as input to InterceptingHttpAccessor.setInterceptors. That method now use AnnotationAwareOrderComparator.sort(interceptors) and in extent Collections.sort which is not side effect free.

InterceptingHttpAccessor.setInterceptors should use a copied list to sort on.

Affects: 5.0 GA, 5.0.1

Issue Links:

  • #18543 Update RestTemplate to respect @Order for ClientHttpRequestInterceptor

Referenced from: commits d06129d

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 31, 2017

Juergen Hoeller commented

I've aligned this with RestTemplate.setMessageConverters, operating on a fixed internal ArrayList that the setter copies the given list to (and which we can then reliably sort).

We're also caching the InterceptingClientHttpRequestFactory instance now as long as the original factory hasn't changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: web type: regression
None yet

No branches or pull requests

2 participants