Polishing

This commit is contained in:
Juergen Hoeller 2019-03-08 09:54:44 +01:00
parent a98e3f0481
commit a06ab6d0ad
2 changed files with 17 additions and 8 deletions

View File

@ -300,8 +300,8 @@ public abstract class AutowireUtils {
* {@link Qualifier @Qualifier}, or {@link Value @Value}. * {@link Qualifier @Qualifier}, or {@link Value @Value}.
* <p>Note that {@link #resolveDependency} may still be able to resolve the * <p>Note that {@link #resolveDependency} may still be able to resolve the
* dependency for the supplied parameter even if this method returns {@code false}. * dependency for the supplied parameter even if this method returns {@code false}.
* @param parameter the parameter whose dependency should be autowired (must not be * @param parameter the parameter whose dependency should be autowired
* {@code null}) * (must not be {@code null})
* @param parameterIndex the index of the parameter in the constructor or method * @param parameterIndex the index of the parameter in the constructor or method
* that declares the parameter * that declares the parameter
* @since 5.2 * @since 5.2
@ -397,8 +397,9 @@ public abstract class AutowireUtils {
return parameter; return parameter;
} }
/** /**
* Reflective InvocationHandler for lazy access to the current target object. * Reflective {@link InvocationHandler} for lazy access to the current target object.
*/ */
@SuppressWarnings("serial") @SuppressWarnings("serial")
private static class ObjectFactoryDelegatingInvocationHandler implements InvocationHandler, Serializable { private static class ObjectFactoryDelegatingInvocationHandler implements InvocationHandler, Serializable {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -52,7 +52,7 @@ import org.springframework.util.StringUtils;
public class CacheControl { public class CacheControl {
@Nullable @Nullable
private Duration maxAge = null; private Duration maxAge;
private boolean noCache = false; private boolean noCache = false;
@ -69,13 +69,13 @@ public class CacheControl {
private boolean proxyRevalidate = false; private boolean proxyRevalidate = false;
@Nullable @Nullable
private Duration staleWhileRevalidate = null; private Duration staleWhileRevalidate;
@Nullable @Nullable
private Duration staleIfError = null; private Duration staleIfError;
@Nullable @Nullable
private Duration sMaxAge = null; private Duration sMaxAge;
/** /**
* Create an empty CacheControl instance. * Create an empty CacheControl instance.
@ -107,6 +107,7 @@ public class CacheControl {
* @param maxAge the maximum time the response should be cached * @param maxAge the maximum time the response should be cached
* @param unit the time unit of the {@code maxAge} argument * @param unit the time unit of the {@code maxAge} argument
* @return {@code this}, to facilitate method chaining * @return {@code this}, to facilitate method chaining
* @see #maxAge(Duration)
* @see <a href="https://tools.ietf.org/html/rfc7234#section-5.2.2.8">rfc7234 section 5.2.2.8</a> * @see <a href="https://tools.ietf.org/html/rfc7234#section-5.2.2.8">rfc7234 section 5.2.2.8</a>
*/ */
public static CacheControl maxAge(long maxAge, TimeUnit unit) { public static CacheControl maxAge(long maxAge, TimeUnit unit) {
@ -124,6 +125,7 @@ public class CacheControl {
* directive should be set ({@link #mustRevalidate()} * directive should be set ({@link #mustRevalidate()}
* @param maxAge the maximum time the response should be cached * @param maxAge the maximum time the response should be cached
* @return {@code this}, to facilitate method chaining * @return {@code this}, to facilitate method chaining
* @since 5.2
* @see <a href="https://tools.ietf.org/html/rfc7234#section-5.2.2.8">rfc7234 section 5.2.2.8</a> * @see <a href="https://tools.ietf.org/html/rfc7234#section-5.2.2.8">rfc7234 section 5.2.2.8</a>
*/ */
public static CacheControl maxAge(Duration maxAge) { public static CacheControl maxAge(Duration maxAge) {
@ -234,6 +236,7 @@ public class CacheControl {
* @param sMaxAge the maximum time the response should be cached * @param sMaxAge the maximum time the response should be cached
* @param unit the time unit of the {@code sMaxAge} argument * @param unit the time unit of the {@code sMaxAge} argument
* @return {@code this}, to facilitate method chaining * @return {@code this}, to facilitate method chaining
* @see #sMaxAge(Duration)
* @see <a href="https://tools.ietf.org/html/rfc7234#section-5.2.2.9">rfc7234 section 5.2.2.9</a> * @see <a href="https://tools.ietf.org/html/rfc7234#section-5.2.2.9">rfc7234 section 5.2.2.9</a>
*/ */
public CacheControl sMaxAge(long sMaxAge, TimeUnit unit) { public CacheControl sMaxAge(long sMaxAge, TimeUnit unit) {
@ -246,6 +249,7 @@ public class CacheControl {
* by this directive overrides the maximum age specified by other directives. * by this directive overrides the maximum age specified by other directives.
* @param sMaxAge the maximum time the response should be cached * @param sMaxAge the maximum time the response should be cached
* @return {@code this}, to facilitate method chaining * @return {@code this}, to facilitate method chaining
* @since 5.2
* @see <a href="https://tools.ietf.org/html/rfc7234#section-5.2.2.9">rfc7234 section 5.2.2.9</a> * @see <a href="https://tools.ietf.org/html/rfc7234#section-5.2.2.9">rfc7234 section 5.2.2.9</a>
*/ */
public CacheControl sMaxAge(Duration sMaxAge) { public CacheControl sMaxAge(Duration sMaxAge) {
@ -263,6 +267,7 @@ public class CacheControl {
* @param staleWhileRevalidate the maximum time the response should be used while being revalidated * @param staleWhileRevalidate the maximum time the response should be used while being revalidated
* @param unit the time unit of the {@code staleWhileRevalidate} argument * @param unit the time unit of the {@code staleWhileRevalidate} argument
* @return {@code this}, to facilitate method chaining * @return {@code this}, to facilitate method chaining
* @see #staleWhileRevalidate(Duration)
* @see <a href="https://tools.ietf.org/html/rfc5861#section-3">rfc5861 section 3</a> * @see <a href="https://tools.ietf.org/html/rfc5861#section-3">rfc5861 section 3</a>
*/ */
public CacheControl staleWhileRevalidate(long staleWhileRevalidate, TimeUnit unit) { public CacheControl staleWhileRevalidate(long staleWhileRevalidate, TimeUnit unit) {
@ -278,6 +283,7 @@ public class CacheControl {
* (i.e. without blocking). * (i.e. without blocking).
* @param staleWhileRevalidate the maximum time the response should be used while being revalidated * @param staleWhileRevalidate the maximum time the response should be used while being revalidated
* @return {@code this}, to facilitate method chaining * @return {@code this}, to facilitate method chaining
* @since 5.2
* @see <a href="https://tools.ietf.org/html/rfc5861#section-3">rfc5861 section 3</a> * @see <a href="https://tools.ietf.org/html/rfc5861#section-3">rfc5861 section 3</a>
*/ */
public CacheControl staleWhileRevalidate(Duration staleWhileRevalidate) { public CacheControl staleWhileRevalidate(Duration staleWhileRevalidate) {
@ -292,6 +298,7 @@ public class CacheControl {
* @param staleIfError the maximum time the response should be used when errors are encountered * @param staleIfError the maximum time the response should be used when errors are encountered
* @param unit the time unit of the {@code staleIfError} argument * @param unit the time unit of the {@code staleIfError} argument
* @return {@code this}, to facilitate method chaining * @return {@code this}, to facilitate method chaining
* @see #staleIfError(Duration)
* @see <a href="https://tools.ietf.org/html/rfc5861#section-4">rfc5861 section 4</a> * @see <a href="https://tools.ietf.org/html/rfc5861#section-4">rfc5861 section 4</a>
*/ */
public CacheControl staleIfError(long staleIfError, TimeUnit unit) { public CacheControl staleIfError(long staleIfError, TimeUnit unit) {
@ -304,6 +311,7 @@ public class CacheControl {
* MAY be used to satisfy the request, regardless of other freshness information. * MAY be used to satisfy the request, regardless of other freshness information.
* @param staleIfError the maximum time the response should be used when errors are encountered * @param staleIfError the maximum time the response should be used when errors are encountered
* @return {@code this}, to facilitate method chaining * @return {@code this}, to facilitate method chaining
* @since 5.2
* @see <a href="https://tools.ietf.org/html/rfc5861#section-4">rfc5861 section 4</a> * @see <a href="https://tools.ietf.org/html/rfc5861#section-4">rfc5861 section 4</a>
*/ */
public CacheControl staleIfError(Duration staleIfError) { public CacheControl staleIfError(Duration staleIfError) {