Browse Source

Polishing

pull/27818/head
Juergen Hoeller 4 years ago
parent
commit
aeff664cf9
  1. 3
      spring-core/src/main/java/org/springframework/core/ResolvableType.java
  2. 1
      spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java
  3. 8
      spring-web/src/main/java/org/springframework/http/client/reactive/HttpComponentsClientHttpRequest.java

3
spring-core/src/main/java/org/springframework/core/ResolvableType.java

@ -976,8 +976,7 @@ public class ResolvableType implements Serializable { @@ -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

1
spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java

@ -59,6 +59,7 @@ final class HttpComponentsClientHttpRequest extends AbstractBufferingClientHttpR @@ -59,6 +59,7 @@ final class HttpComponentsClientHttpRequest extends AbstractBufferingClientHttpR
this.httpContext = context;
}
@Override
public HttpMethod getMethod() {
return HttpMethod.valueOf(this.httpRequest.getMethod());

8
spring-web/src/main/java/org/springframework/http/client/reactive/HttpComponentsClientHttpRequest.java

@ -1,5 +1,5 @@ @@ -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; @@ -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 { @@ -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);
}
}

Loading…
Cancel
Save