1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2015 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -115,7 +115,9 @@ public AsyncRestTemplate(AsyncClientHttpRequestFactory asyncRequestFactory) {
115
115
* @param asyncRequestFactory the asynchronous request factory
116
116
* @param syncRequestFactory the synchronous request factory
117
117
*/
118
- public AsyncRestTemplate (AsyncClientHttpRequestFactory asyncRequestFactory , ClientHttpRequestFactory syncRequestFactory ) {
118
+ public AsyncRestTemplate (
119
+ AsyncClientHttpRequestFactory asyncRequestFactory , ClientHttpRequestFactory syncRequestFactory ) {
120
+
119
121
this (asyncRequestFactory , new RestTemplate (syncRequestFactory ));
120
122
}
121
123
@@ -126,7 +128,7 @@ public AsyncRestTemplate(AsyncClientHttpRequestFactory asyncRequestFactory, Clie
126
128
* @param restTemplate the synchronous template to use
127
129
*/
128
130
public AsyncRestTemplate (AsyncClientHttpRequestFactory requestFactory , RestTemplate restTemplate ) {
129
- Assert .notNull (restTemplate , "'restTemplate' must not be null" );
131
+ Assert .notNull (restTemplate , "RestTemplate must not be null" );
130
132
this .syncTemplate = restTemplate ;
131
133
setAsyncRequestFactory (requestFactory );
132
134
}
@@ -141,7 +143,9 @@ public void setErrorHandler(ResponseErrorHandler errorHandler) {
141
143
this .syncTemplate .setErrorHandler (errorHandler );
142
144
}
143
145
144
- /** Return the error handler. */
146
+ /**
147
+ * Return the error handler.
148
+ */
145
149
public ResponseErrorHandler getErrorHandler () {
146
150
return this .syncTemplate .getErrorHandler ();
147
151
}
@@ -163,7 +167,7 @@ public void setMessageConverters(List<HttpMessageConverter<?>> messageConverters
163
167
* Return the message body converters.
164
168
*/
165
169
public List <HttpMessageConverter <?>> getMessageConverters () {
166
- return syncTemplate .getMessageConverters ();
170
+ return this . syncTemplate .getMessageConverters ();
167
171
}
168
172
169
173
@@ -215,6 +219,7 @@ public ListenableFuture<HttpHeaders> headForHeaders(URI url) throws RestClientEx
215
219
return execute (url , HttpMethod .HEAD , null , headersExtractor );
216
220
}
217
221
222
+
218
223
// POST
219
224
220
225
@ Override
@@ -639,7 +644,7 @@ protected final T adapt(ClientHttpResponse response) throws ExecutionException {
639
644
}
640
645
return convertResponse (response );
641
646
}
642
- catch (IOException ex ) {
647
+ catch (Throwable ex ) {
643
648
throw new ExecutionException (ex );
644
649
}
645
650
finally {
0 commit comments