diff --git a/spring-core/src/main/java/org/springframework/util/AlternativeJdkIdGenerator.java b/spring-core/src/main/java/org/springframework/util/AlternativeJdkIdGenerator.java index 31a9b05ace7..9da7e0e5ca7 100644 --- a/spring-core/src/main/java/org/springframework/util/AlternativeJdkIdGenerator.java +++ b/spring-core/src/main/java/org/springframework/util/AlternativeJdkIdGenerator.java @@ -22,11 +22,10 @@ import java.util.Random; import java.util.UUID; /** - * An {@link org.springframework.util.IdGenerator IdGenerator} that uses - * {@link SecureRandom} for the initial seed and {@link Random} thereafter - * instead of calling {@link UUID#randomUUID()} every time as - * {@link org.springframework.util.JdkIdGenerator JdkIdGenerator} does. - * This provides a better balance between securely random id's and performance. + * An {@link IdGenerator} that uses {@link SecureRandom} for the initial seed and + * {@link Random} thereafter, instead of calling {@link UUID#randomUUID()} every + * time as {@link org.springframework.util.JdkIdGenerator JdkIdGenerator} does. + * This provides a better balance between securely random ids and performance. * * @author Rossen Stoyanchev * @author Rob Winch diff --git a/spring-core/src/main/java/org/springframework/util/JdkIdGenerator.java b/spring-core/src/main/java/org/springframework/util/JdkIdGenerator.java index 5d422126a8b..603e5c9e86d 100644 --- a/spring-core/src/main/java/org/springframework/util/JdkIdGenerator.java +++ b/spring-core/src/main/java/org/springframework/util/JdkIdGenerator.java @@ -19,11 +19,10 @@ package org.springframework.util; import java.util.UUID; /** - * An {@link org.springframework.util.IdGenerator IdGenerator} that calls - * {@link java.util.UUID#randomUUID()}. + * An {@link IdGenerator} that calls {@link java.util.UUID#randomUUID()}. * * @author Rossen Stoyanchev - * @since 4.2 + * @since 4.1.5 */ public class JdkIdGenerator implements IdGenerator { diff --git a/spring-core/src/main/java/org/springframework/util/SimpleIdGenerator.java b/spring-core/src/main/java/org/springframework/util/SimpleIdGenerator.java index 7b0b4c3d40c..b7eca18507c 100644 --- a/spring-core/src/main/java/org/springframework/util/SimpleIdGenerator.java +++ b/spring-core/src/main/java/org/springframework/util/SimpleIdGenerator.java @@ -20,11 +20,10 @@ import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; /** - * A simple {@link org.springframework.util.IdGenerator IdGenerator} that - * starts at 1 and increments by 1 with each call. + * A simple {@link IdGenerator} that starts at 1 and increments by 1 with each call. * * @author Rossen Stoyanchev - * @since 4.2 + * @since 4.1.5 */ public class SimpleIdGenerator implements IdGenerator { diff --git a/spring-web/src/main/java/org/springframework/web/client/MessageBodyClientHttpResponseWrapper.java b/spring-web/src/main/java/org/springframework/web/client/MessageBodyClientHttpResponseWrapper.java index 55ed1d35508..b36e37d885e 100644 --- a/spring-web/src/main/java/org/springframework/web/client/MessageBodyClientHttpResponseWrapper.java +++ b/spring-web/src/main/java/org/springframework/web/client/MessageBodyClientHttpResponseWrapper.java @@ -25,8 +25,9 @@ import org.springframework.http.HttpStatus; import org.springframework.http.client.ClientHttpResponse; /** - * Implementation of {@link ClientHttpResponse} that can not only check if the response - * has a message body, but also if its length is 0 (i.e. empty) by actually reading the input stream. + * Implementation of {@link ClientHttpResponse} that can not only check if + * the response has a message body, but also if its length is 0 (i.e. empty) + * by actually reading the input stream. * * @author Brian Clozel * @since 4.1.5 @@ -34,23 +35,23 @@ import org.springframework.http.client.ClientHttpResponse; */ class MessageBodyClientHttpResponseWrapper implements ClientHttpResponse { + private final ClientHttpResponse response; + private PushbackInputStream pushbackInputStream; - private final ClientHttpResponse response; public MessageBodyClientHttpResponseWrapper(ClientHttpResponse response) throws IOException { this.response = response; } + /** * Indicates whether the response has a message body. - * *
Implementation returns {@code false} for: *
Implementation tries to read the first bytes of the response stream: *