From c7774680564726153eb34c5c6d3e8bb80dd54f07 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 8 Jun 2020 19:37:58 +0200 Subject: [PATCH 1/3] Polishing --- .../aop/config/AopNamespaceHandler.java | 6 +- .../web/util/DefaultUriBuilderFactory.java | 112 +++++++++--------- .../web/util/UriBuilderFactory.java | 6 +- 3 files changed, 63 insertions(+), 61 deletions(-) diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java b/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java index 99eb2fa6f59..fa6cc80a1f3 100644 --- a/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java +++ b/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2020 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. @@ -61,12 +61,12 @@ public class AopNamespaceHandler extends NamespaceHandlerSupport { */ @Override public void init() { - // In 2.0 XSD as well as in 2.1 XSD. + // In 2.0 XSD as well as in 2.5+ XSDs registerBeanDefinitionParser("config", new ConfigBeanDefinitionParser()); registerBeanDefinitionParser("aspectj-autoproxy", new AspectJAutoProxyBeanDefinitionParser()); registerBeanDefinitionDecorator("scoped-proxy", new ScopedProxyBeanDefinitionDecorator()); - // Only in 2.0 XSD: moved to context namespace as of 2.1 + // Only in 2.0 XSD: moved to context namespace in 2.5+ registerBeanDefinitionParser("spring-configured", new SpringConfiguredBeanDefinitionParser()); } diff --git a/spring-web/src/main/java/org/springframework/web/util/DefaultUriBuilderFactory.java b/spring-web/src/main/java/org/springframework/web/util/DefaultUriBuilderFactory.java index 1df9e750991..1b90021c28d 100644 --- a/spring-web/src/main/java/org/springframework/web/util/DefaultUriBuilderFactory.java +++ b/spring-web/src/main/java/org/springframework/web/util/DefaultUriBuilderFactory.java @@ -40,62 +40,6 @@ import org.springframework.util.StringUtils; */ public class DefaultUriBuilderFactory implements UriBuilderFactory { - /** - * Enum to represent multiple URI encoding strategies. The following are - * available: - * - * @see #setEncodingMode - */ - public enum EncodingMode { - - /** - * Pre-encode the URI template first, then strictly encode URI variables - * when expanded, with the following rules: - * - *

For most cases, this mode is most likely to give the expected - * result because in treats URI variables as opaque data to be fully - * encoded, while {@link #URI_COMPONENT} by comparison is useful only - * if intentionally expanding URI variables with reserved characters. - * @since 5.0.8 - * @see UriComponentsBuilder#encode() - */ - TEMPLATE_AND_VALUES, - - /** - * Does not encode the URI template and instead applies strict encoding - * to URI variables via {@link UriUtils#encodeUriVariables} prior to - * expanding them into the template. - * @see UriUtils#encodeUriVariables(Object...) - * @see UriUtils#encodeUriVariables(Map) - */ - VALUES_ONLY, - - /** - * Expand URI variables first, and then encode the resulting URI - * component values, replacing only non-ASCII and illegal - * (within a given URI component type) characters, but not characters - * with reserved meaning. - * @see UriComponents#encode() - */ - URI_COMPONENT, - - /** - * No encoding should be applied. - */ - NONE - } - - @Nullable private final UriComponentsBuilder baseUri; @@ -222,6 +166,62 @@ public class DefaultUriBuilderFactory implements UriBuilderFactory { } + /** + * Enum to represent multiple URI encoding strategies. The following are + * available: + *

+ * @see #setEncodingMode + */ + public enum EncodingMode { + + /** + * Pre-encode the URI template first, then strictly encode URI variables + * when expanded, with the following rules: + * + *

For most cases, this mode is most likely to give the expected + * result because in treats URI variables as opaque data to be fully + * encoded, while {@link #URI_COMPONENT} by comparison is useful only + * if intentionally expanding URI variables with reserved characters. + * @since 5.0.8 + * @see UriComponentsBuilder#encode() + */ + TEMPLATE_AND_VALUES, + + /** + * Does not encode the URI template and instead applies strict encoding + * to URI variables via {@link UriUtils#encodeUriVariables} prior to + * expanding them into the template. + * @see UriUtils#encodeUriVariables(Object...) + * @see UriUtils#encodeUriVariables(Map) + */ + VALUES_ONLY, + + /** + * Expand URI variables first, and then encode the resulting URI + * component values, replacing only non-ASCII and illegal + * (within a given URI component type) characters, but not characters + * with reserved meaning. + * @see UriComponents#encode() + */ + URI_COMPONENT, + + /** + * No encoding should be applied. + */ + NONE + } + + /** * {@link DefaultUriBuilderFactory} specific implementation of UriBuilder. */ diff --git a/spring-web/src/main/java/org/springframework/web/util/UriBuilderFactory.java b/spring-web/src/main/java/org/springframework/web/util/UriBuilderFactory.java index c1d7698123f..ddd5f5dd833 100644 --- a/spring-web/src/main/java/org/springframework/web/util/UriBuilderFactory.java +++ b/spring-web/src/main/java/org/springframework/web/util/UriBuilderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 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. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.web.util; /** @@ -22,13 +23,14 @@ package org.springframework.web.util; * * @author Rossen Stoyanchev * @since 5.0 + * @see DefaultUriBuilderFactory */ public interface UriBuilderFactory extends UriTemplateHandler { /** * Initialize a builder with the given URI template. * @param uriTemplate the URI template to use - * @return the URI builder instance + * @return the builder instance */ UriBuilder uriString(String uriTemplate); From d2cd4c50f4875f598143ab9cbb1c8f12fa74c16b Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 8 Jun 2020 19:38:23 +0200 Subject: [PATCH 2/3] Upgrade to Tomcat 9.0.36 --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 1d32d1af139..fff8ec72709 100644 --- a/build.gradle +++ b/build.gradle @@ -120,14 +120,14 @@ configure(allprojects) { project -> dependency "org.webjars:webjars-locator-core:0.45" dependency "org.webjars:underscorejs:1.8.3" - dependencySet(group: 'org.apache.tomcat', version: '9.0.35') { + dependencySet(group: 'org.apache.tomcat', version: '9.0.36') { entry 'tomcat-util' entry('tomcat-websocket') { exclude group: "org.apache.tomcat", name: "tomcat-websocket-api" exclude group: "org.apache.tomcat", name: "tomcat-servlet-api" } } - dependencySet(group: 'org.apache.tomcat.embed', version: '9.0.35') { + dependencySet(group: 'org.apache.tomcat.embed', version: '9.0.36') { entry 'tomcat-embed-core' entry 'tomcat-embed-websocket' } From 4c29bbb77fb46d2e78ef48fb429fe222cf2bfb89 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 8 Jun 2020 20:23:37 +0200 Subject: [PATCH 3/3] Upgrade to Reactor Dysprosium-SR8 Closes gh-25210 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index fff8ec72709..add4ccf1a75 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ configure(allprojects) { project -> imports { mavenBom "com.fasterxml.jackson:jackson-bom:2.10.4" mavenBom "io.netty:netty-bom:4.1.50.Final" - mavenBom "io.projectreactor:reactor-bom:Dysprosium-SR7" + mavenBom "io.projectreactor:reactor-bom:Dysprosium-SR8" mavenBom "io.rsocket:rsocket-bom:1.0.0" mavenBom "org.eclipse.jetty:jetty-bom:9.4.29.v20200521" mavenBom "org.jetbrains.kotlin:kotlin-bom:1.3.72"