Browse Source

RestTemplate accepts getMessageConverters() List on setMessageConverters again

Issue: SPR-11962
pull/584/merge
Juergen Hoeller 11 years ago
parent
commit
1222ca38fb
  1. 3
      spring-web/src/main/java/org/springframework/web/client/RestTemplate.java

3
spring-web/src/main/java/org/springframework/web/client/RestTemplate.java

@ -202,9 +202,12 @@ public class RestTemplate extends InterceptingHttpAccessor implements RestOperat @@ -202,9 +202,12 @@ public class RestTemplate extends InterceptingHttpAccessor implements RestOperat
*/
public void setMessageConverters(List<HttpMessageConverter<?>> messageConverters) {
Assert.notEmpty(messageConverters, "'messageConverters' must not be empty");
// Take getMessageConverters() List as-is when passed in here
if (this.messageConverters != messageConverters) {
this.messageConverters.clear();
this.messageConverters.addAll(messageConverters);
}
}
/**
* Return the message body converters.

Loading…
Cancel
Save