Skip to content

Commit ee861e8

Browse files
committed
Fix compiler deprecation-related errors
1 parent ecb2e97 commit ee861e8

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

spring-web/src/main/java/org/springframework/web/client/AsyncRestTemplate.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import org.springframework.util.Assert;
4545
import org.springframework.util.concurrent.ListenableFuture;
4646
import org.springframework.util.concurrent.ListenableFutureAdapter;
47-
import org.springframework.web.util.AbstractUriTemplateHandler;
4847
import org.springframework.web.util.DefaultUriBuilderFactory;
4948
import org.springframework.web.util.UriTemplateHandler;
5049

@@ -162,13 +161,15 @@ public ResponseErrorHandler getErrorHandler() {
162161
* @param defaultUriVariables the default URI variable values
163162
* @since 4.3
164163
*/
164+
@SuppressWarnings("deprecation")
165165
public void setDefaultUriVariables(Map<String, ?> defaultUriVariables) {
166166
UriTemplateHandler handler = this.syncTemplate.getUriTemplateHandler();
167167
if (handler instanceof DefaultUriBuilderFactory) {
168168
((DefaultUriBuilderFactory) handler).setDefaultUriVariables(defaultUriVariables);
169169
}
170-
else if (handler instanceof AbstractUriTemplateHandler) {
171-
((AbstractUriTemplateHandler) handler).setDefaultUriVariables(defaultUriVariables);
170+
else if (handler instanceof org.springframework.web.util.AbstractUriTemplateHandler) {
171+
((org.springframework.web.util.AbstractUriTemplateHandler) handler)
172+
.setDefaultUriVariables(defaultUriVariables);
172173
}
173174
else {
174175
throw new IllegalArgumentException(

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
import org.springframework.http.converter.xml.SourceHttpMessageConverter;
5353
import org.springframework.util.Assert;
5454
import org.springframework.util.ClassUtils;
55-
import org.springframework.web.util.AbstractUriTemplateHandler;
5655
import org.springframework.web.util.DefaultUriBuilderFactory;
5756
import org.springframework.web.util.UriTemplateHandler;
5857

@@ -263,12 +262,14 @@ public ResponseErrorHandler getErrorHandler() {
263262
* @param uriVars the default URI variable values
264263
* @since 4.3
265264
*/
265+
@SuppressWarnings("deprecation")
266266
public void setDefaultUriVariables(Map<String, ?> uriVars) {
267267
if (this.uriTemplateHandler instanceof DefaultUriBuilderFactory) {
268268
((DefaultUriBuilderFactory) this.uriTemplateHandler).setDefaultUriVariables(uriVars);
269269
}
270-
else if (this.uriTemplateHandler instanceof AbstractUriTemplateHandler) {
271-
((AbstractUriTemplateHandler) this.uriTemplateHandler).setDefaultUriVariables(uriVars);
270+
else if (this.uriTemplateHandler instanceof org.springframework.web.util.AbstractUriTemplateHandler) {
271+
((org.springframework.web.util.AbstractUriTemplateHandler) this.uriTemplateHandler)
272+
.setDefaultUriVariables(uriVars);
272273
}
273274
else {
274275
throw new IllegalArgumentException(

0 commit comments

Comments
 (0)