diff --git a/spring-core/src/main/java/org/springframework/core/ResolvableType.java b/spring-core/src/main/java/org/springframework/core/ResolvableType.java index 17a9572ccd0..c78ecd1d459 100644 --- a/spring-core/src/main/java/org/springframework/core/ResolvableType.java +++ b/spring-core/src/main/java/org/springframework/core/ResolvableType.java @@ -976,8 +976,7 @@ public class ResolvableType implements Serializable { if (this.resolved == null) { return "?"; } - if (this.type instanceof TypeVariable) { - TypeVariable variable = (TypeVariable) this.type; + if (this.type instanceof TypeVariable variable) { if (this.variableResolver == null || this.variableResolver.resolveVariable(variable) == null) { // Don't bother with variable boundaries for toString()... // Can cause infinite recursions in case of self-references diff --git a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java index 36440555372..f837391ed95 100644 --- a/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java @@ -59,6 +59,7 @@ final class HttpComponentsClientHttpRequest extends AbstractBufferingClientHttpR this.httpContext = context; } + @Override public HttpMethod getMethod() { return HttpMethod.valueOf(this.httpRequest.getMethod()); diff --git a/spring-web/src/main/java/org/springframework/http/client/reactive/HttpComponentsClientHttpRequest.java b/spring-web/src/main/java/org/springframework/http/client/reactive/HttpComponentsClientHttpRequest.java index 40c6af39b58..8af84d6f0e0 100644 --- a/spring-web/src/main/java/org/springframework/http/client/reactive/HttpComponentsClientHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/client/reactive/HttpComponentsClientHttpRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,12 +39,12 @@ import org.springframework.core.io.buffer.DataBuffer; import org.springframework.core.io.buffer.DataBufferFactory; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; import org.springframework.lang.Nullable; -import static org.springframework.http.MediaType.ALL_VALUE; - /** * {@link ClientHttpRequest} implementation for the Apache HttpComponents HttpClient 5.x. + * * @author Martin Tarjányi * @author Arjen Poutsma * @since 5.3 @@ -125,7 +125,7 @@ class HttpComponentsClientHttpRequest extends AbstractClientHttpRequest { .forEach(entry -> entry.getValue().forEach(v -> this.httpRequest.addHeader(entry.getKey(), v))); if (!this.httpRequest.containsHeader(HttpHeaders.ACCEPT)) { - this.httpRequest.addHeader(HttpHeaders.ACCEPT, ALL_VALUE); + this.httpRequest.addHeader(HttpHeaders.ACCEPT, MediaType.ALL_VALUE); } }