From 3dbeff56e4e859742a8b647b901f9b2c37e521a3 Mon Sep 17 00:00:00 2001 From: Welton Rodrigo Torres Nascimento Date: Thu, 5 Jul 2018 11:16:10 -0300 Subject: [PATCH 1/2] Clarify that RestTemplateBuilder overwrites default converters See gh-13714 --- .../boot/web/client/RestTemplateBuilder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java b/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java index 3b2c5277079..e22017826be 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java @@ -201,7 +201,8 @@ public class RestTemplateBuilder { /** * Add additional {@link HttpMessageConverter HttpMessageConverters} that should be - * used with the {@link RestTemplate}. + * used with the {@link RestTemplate}. The final list of converters replace any + * RestTemplate came configured with. * @param messageConverters the converters to add * @return a new builder instance * @see #messageConverters(HttpMessageConverter...) @@ -214,7 +215,8 @@ public class RestTemplateBuilder { /** * Add additional {@link HttpMessageConverter HttpMessageConverters} that should be - * used with the {@link RestTemplate}. + * used with the {@link RestTemplate}. The final list of converters replace any + * RestTemplate came configured with. * @param messageConverters the converters to add * @return a new builder instance * @see #messageConverters(HttpMessageConverter...) From 5c1d22eed8b79191192c0bf899fe116131f9c522 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 1 Oct 2018 15:37:31 +0100 Subject: [PATCH 2/2] Polish "Clarify that RestTemplateBuilder overwrites default converters" Closes gh-13714 --- .../boot/web/client/RestTemplateBuilder.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java b/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java index e22017826be..6be2233f316 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java @@ -169,7 +169,8 @@ public class RestTemplateBuilder { /** * Set the {@link HttpMessageConverter HttpMessageConverters} that should be used with * the {@link RestTemplate}. Setting this value will replace any previously configured - * converters. + * converters and any converters configured on the builder will replace RestTemplate's + * default converters. * @param messageConverters the converters to set * @return a new builder instance * @see #additionalMessageConverters(HttpMessageConverter...) @@ -183,7 +184,8 @@ public class RestTemplateBuilder { /** * Set the {@link HttpMessageConverter HttpMessageConverters} that should be used with * the {@link RestTemplate}. Setting this value will replace any previously configured - * converters. + * converters and any converters configured on the builder will replace RestTemplate's + * default converters. * @param messageConverters the converters to set * @return a new builder instance * @see #additionalMessageConverters(HttpMessageConverter...) @@ -201,8 +203,8 @@ public class RestTemplateBuilder { /** * Add additional {@link HttpMessageConverter HttpMessageConverters} that should be - * used with the {@link RestTemplate}. The final list of converters replace any - * RestTemplate came configured with. + * used with the {@link RestTemplate}. Any converters configured on the builder will + * replace RestTemplate's default converters. * @param messageConverters the converters to add * @return a new builder instance * @see #messageConverters(HttpMessageConverter...) @@ -215,8 +217,8 @@ public class RestTemplateBuilder { /** * Add additional {@link HttpMessageConverter HttpMessageConverters} that should be - * used with the {@link RestTemplate}. The final list of converters replace any - * RestTemplate came configured with. + * used with the {@link RestTemplate}. Any converters configured on the builder will + * replace RestTemplate's default converters. * @param messageConverters the converters to add * @return a new builder instance * @see #messageConverters(HttpMessageConverter...)