Closes gh-33566
This commit is contained in:
Johnny Lim 2024-09-19 14:57:52 +09:00 committed by Sam Brannen
parent 6120076437
commit 3ba9d35e22
12 changed files with 21 additions and 28 deletions

View File

@ -385,7 +385,7 @@ To customize the default message, you can add properties to
xref:core/beans/context-introduction.adoc#context-functionality-messagesource[MessageSource] xref:core/beans/context-introduction.adoc#context-functionality-messagesource[MessageSource]
resource bundles using any of the above errors codes and message arguments. Note also that the resource bundles using any of the above errors codes and message arguments. Note also that the
message argument `"name"` is itself a `MessageSourceResolvable` with error codes message argument `"name"` is itself a `MessageSourceResolvable` with error codes
`"person.name"` and `"name"` and can customized too. For example: `"person.name"` and `"name"` and can be customized too. For example:
Properties:: Properties::
+ +

View File

@ -160,7 +160,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
/** Map from scope identifier String to corresponding Scope. */ /** Map from scope identifier String to corresponding Scope. */
private final Map<String, Scope> scopes = new LinkedHashMap<>(8); private final Map<String, Scope> scopes = new LinkedHashMap<>(8);
/** Application startup metrics. **/ /** Application startup metrics. */
private ApplicationStartup applicationStartup = ApplicationStartup.DEFAULT; private ApplicationStartup applicationStartup = ApplicationStartup.DEFAULT;
/** Map from bean name to merged RootBeanDefinition. */ /** Map from bean name to merged RootBeanDefinition. */

View File

@ -234,7 +234,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
@Nullable @Nullable
private ApplicationEventMulticaster applicationEventMulticaster; private ApplicationEventMulticaster applicationEventMulticaster;
/** Application startup metrics. **/ /** Application startup metrics. */
private ApplicationStartup applicationStartup = ApplicationStartup.DEFAULT; private ApplicationStartup applicationStartup = ApplicationStartup.DEFAULT;
/** Statically specified listeners. */ /** Statically specified listeners. */

View File

@ -107,7 +107,7 @@ class ChannelSendOperator<T> extends Mono<Void> implements Scannable {
* The write subscriber has subscribed, and cached signals have been * The write subscriber has subscribed, and cached signals have been
* emitted to it; we're ready to switch to a simple pass-through mode * emitted to it; we're ready to switch to a simple pass-through mode
* for all remaining signals. * for all remaining signals.
**/ */
READY_TO_WRITE READY_TO_WRITE
} }

View File

@ -45,6 +45,7 @@ public class MockCookie extends Cookie {
private static final String SAME_SITE = "SameSite"; private static final String SAME_SITE = "SameSite";
private static final String EXPIRES = "Expires"; private static final String EXPIRES = "Expires";
private static final String PARTITIONED = "Partitioned";
@Nullable @Nullable
private ZonedDateTime expires; private ZonedDateTime expires;
@ -105,10 +106,10 @@ public class MockCookie extends Cookie {
*/ */
public void setPartitioned(boolean partitioned) { public void setPartitioned(boolean partitioned) {
if (partitioned) { if (partitioned) {
setAttribute("Partitioned", ""); setAttribute(PARTITIONED, "");
} }
else { else {
setAttribute("Partitioned", null); setAttribute(PARTITIONED, null);
} }
} }
@ -118,7 +119,7 @@ public class MockCookie extends Cookie {
* @see <a href="https://datatracker.ietf.org/doc/html/draft-cutler-httpbis-partitioned-cookies#section-2.1">The Partitioned attribute spec</a> * @see <a href="https://datatracker.ietf.org/doc/html/draft-cutler-httpbis-partitioned-cookies#section-2.1">The Partitioned attribute spec</a>
*/ */
public boolean isPartitioned() { public boolean isPartitioned() {
return getAttribute("Partitioned") != null; return getAttribute(PARTITIONED) != null;
} }
/** /**
@ -207,7 +208,7 @@ public class MockCookie extends Cookie {
.append("Comment", getComment()) .append("Comment", getComment())
.append("Secure", getSecure()) .append("Secure", getSecure())
.append("HttpOnly", isHttpOnly()) .append("HttpOnly", isHttpOnly())
.append("Partitioned", isPartitioned()) .append(PARTITIONED, isPartitioned())
.append(SAME_SITE, getSameSite()) .append(SAME_SITE, getSameSite())
.append("Max-Age", getMaxAge()) .append("Max-Age", getMaxAge())
.append(EXPIRES, getAttribute(EXPIRES)) .append(EXPIRES, getAttribute(EXPIRES))

View File

@ -51,7 +51,7 @@ public class JdkClientHttpConnector implements ClientHttpConnector {
private DataBufferFactory bufferFactory = DefaultDataBufferFactory.sharedInstance; private DataBufferFactory bufferFactory = DefaultDataBufferFactory.sharedInstance;
@Nullable @Nullable
private Duration readTimeout = null; private Duration readTimeout;
/** /**

View File

@ -99,7 +99,7 @@ public class ChannelSendOperator<T> extends Mono<Void> implements Scannable {
* The write subscriber has subscribed, and cached signals have been * The write subscriber has subscribed, and cached signals have been
* emitted to it; we're ready to switch to a simple pass-through mode * emitted to it; we're ready to switch to a simple pass-through mode
* for all remaining signals. * for all remaining signals.
**/ */
READY_TO_WRITE READY_TO_WRITE
} }

View File

@ -70,10 +70,10 @@ public class RequestAttributesThreadLocalAccessor implements ThreadLocalAccessor
/** /**
* ServletRequestAttributes that takes another instance, and makes a copy of the * ServletRequestAttributes that takes another instance, and makes a copy of the
* request attributes at present to provides extended read access during async * request attributes at present to provide extended read access during async
* handling when the DispatcherServlet has exited from the initial REQUEST dispatch * handling when the DispatcherServlet has exited from the initial REQUEST dispatch
* and marked the request {@link ServletRequestAttributes#requestCompleted()}. * and marked the request {@link ServletRequestAttributes#requestCompleted()}.
* <p>Note that beyond access to request attributes, here is no attempt to support * <p>Note that beyond access to request attributes, there is no attempt to support
* setting or removing request attributes, nor to access session attributes after * setting or removing request attributes, nor to access session attributes after
* the initial REQUEST dispatch has exited. * the initial REQUEST dispatch has exited.
*/ */

View File

@ -174,7 +174,7 @@ class Jackson2JsonDecoderTests extends AbstractDecoderTests<Jackson2JsonDecoder>
} }
@Test @Test
protected void decodeToFluxWithListElements() { void decodeToFluxWithListElements() {
Flux<DataBuffer> input = Flux.concat( Flux<DataBuffer> input = Flux.concat(
stringBuffer("[{\"bar\":\"b1\",\"foo\":\"f1\"},{\"bar\":\"b2\",\"foo\":\"f2\"}]"), stringBuffer("[{\"bar\":\"b1\",\"foo\":\"f1\"},{\"bar\":\"b2\",\"foo\":\"f2\"}]"),
stringBuffer("[{\"bar\":\"b3\",\"foo\":\"f3\"},{\"bar\":\"b4\",\"foo\":\"f4\"}]")); stringBuffer("[{\"bar\":\"b3\",\"foo\":\"f3\"},{\"bar\":\"b4\",\"foo\":\"f4\"}]"));

View File

@ -17,15 +17,12 @@
package org.springframework.web.util; package org.springframework.web.util;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.util.FastByteArrayOutputStream;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.testfixture.servlet.MockHttpServletRequest; import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
@ -95,13 +92,7 @@ class ContentCachingRequestWrapperTests {
@Test @Test
void shouldNotAllocateMoreThanCacheLimit() throws Exception { void shouldNotAllocateMoreThanCacheLimit() throws Exception {
ContentCachingRequestWrapper wrapper = new ContentCachingRequestWrapper(createGetRequest("Hello World"), CONTENT_CACHE_LIMIT); ContentCachingRequestWrapper wrapper = new ContentCachingRequestWrapper(createGetRequest("Hello World"), CONTENT_CACHE_LIMIT);
Field field = ReflectionUtils.findField(ContentCachingRequestWrapper.class, "cachedContent"); assertThat(wrapper).extracting("cachedContent.initialBlockSize").isEqualTo(CONTENT_CACHE_LIMIT);
ReflectionUtils.makeAccessible(field);
FastByteArrayOutputStream cachedContent = (FastByteArrayOutputStream) ReflectionUtils.getField(field, wrapper);
field = ReflectionUtils.findField(FastByteArrayOutputStream.class, "initialBlockSize");
ReflectionUtils.makeAccessible(field);
int blockSize = (int) ReflectionUtils.getField(field, cachedContent);
assertThat(blockSize).isEqualTo(CONTENT_CACHE_LIMIT);
} }

View File

@ -45,6 +45,7 @@ public class MockCookie extends Cookie {
private static final String SAME_SITE = "SameSite"; private static final String SAME_SITE = "SameSite";
private static final String EXPIRES = "Expires"; private static final String EXPIRES = "Expires";
private static final String PARTITIONED = "Partitioned";
@Nullable @Nullable
private ZonedDateTime expires; private ZonedDateTime expires;
@ -105,10 +106,10 @@ public class MockCookie extends Cookie {
*/ */
public void setPartitioned(boolean partitioned) { public void setPartitioned(boolean partitioned) {
if (partitioned) { if (partitioned) {
setAttribute("Partitioned", ""); setAttribute(PARTITIONED, "");
} }
else { else {
setAttribute("Partitioned", null); setAttribute(PARTITIONED, null);
} }
} }
@ -118,7 +119,7 @@ public class MockCookie extends Cookie {
* @see <a href="https://datatracker.ietf.org/doc/html/draft-cutler-httpbis-partitioned-cookies#section-2.1">The Partitioned attribute spec</a> * @see <a href="https://datatracker.ietf.org/doc/html/draft-cutler-httpbis-partitioned-cookies#section-2.1">The Partitioned attribute spec</a>
*/ */
public boolean isPartitioned() { public boolean isPartitioned() {
return getAttribute("Partitioned") != null; return getAttribute(PARTITIONED) != null;
} }
/** /**
@ -202,7 +203,7 @@ public class MockCookie extends Cookie {
.append("Comment", getComment()) .append("Comment", getComment())
.append("Secure", getSecure()) .append("Secure", getSecure())
.append("HttpOnly", isHttpOnly()) .append("HttpOnly", isHttpOnly())
.append("Partitioned", isPartitioned()) .append(PARTITIONED, isPartitioned())
.append(SAME_SITE, getSameSite()) .append(SAME_SITE, getSameSite())
.append("Max-Age", getMaxAge()) .append("Max-Age", getMaxAge())
.append(EXPIRES, getAttribute(EXPIRES)) .append(EXPIRES, getAttribute(EXPIRES))

View File

@ -23,7 +23,7 @@ import org.springframework.lang.Nullable;
/** /**
* Abstract base class for URL-based views. Provides a consistent way of * Abstract base class for URL-based views. Provides a consistent way of
* holding the URL that a View wraps, in the form of an "url" bean property. * holding the URL that a View wraps, in the form of a "url" bean property.
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 13.12.2003 * @since 13.12.2003