Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INT-3698: HTTP MH: Remove Internal Converters
JIRA: https://jira.spring.io/browse/INT-3698 The `HttpRequestExecutingMessageHandler` added two internal `Converters` to the `ConversionService` before. In case of parent-child environment it causes memory leak: closing of child context doesn't release `HttpRequestExecutingMessageHandler` instances, because those internal `Converters` aren't `static`, hence bounded to outer instance. Actually after introduction since `4.0` version to the `HttpRequestExecutingMessageHandler` the code like: ``` Assert.isTrue(expectedResponseType instanceof Class<?> || expectedResponseType instanceof String || expectedResponseType instanceof ParameterizedTypeReference, "'expectedResponseType' can be an instance of 'Class<?>', 'String' or 'ParameterizedTypeReference<?>'."); if (expectedResponseType instanceof String && StringUtils.hasText((String) expectedResponseType)){ expectedResponseType = ClassUtils.forName((String) expectedResponseType, ClassUtils.getDefaultClassLoader()); } ``` These converters are redundant. In addition remove the `expected type` for the `uriVariablesExpression` evaluation to avoid `MapToMapConverter`. **Cherry-pick to 4.1.x, 4.0.x** INT-3698: Provide robust logic for the `uriExpression` and `httpMethodExpression` Make some polishing around `Assert`s, when `IllegalStateException` must be presented instead of `IllegalArgumentException` for the expression evaluation results. Polishing
- Loading branch information
1 parent
73522d2
commit 2aac441
Showing
4 changed files
with
69 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.