diff --git a/spring-core/src/test/java/example/japanese/バリューオブジェクト/バリューオブジェクト.java b/spring-core/src/test/java/example/japanese/バリューオブジェクト/バリューオブジェクト.java deleted file mode 100644 index cede9b20edd..00000000000 --- a/spring-core/src/test/java/example/japanese/バリューオブジェクト/バリューオブジェクト.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2002-2022 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. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package example.japanese.バリューオブジェクト; - -/** - * This class and its package exist in order to test encoding and Unicode - * normalization for resource paths discovered via classpath scanning. - * - *

"バリューオブジェクト" is Japanese for "value object". - */ -public class バリューオブジェクト { -} diff --git a/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java b/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java index 2e5c3ad8b50..3870b65dd8a 100644 --- a/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java @@ -19,9 +19,7 @@ package org.springframework.core.io.support; import java.io.FileNotFoundException; import java.io.IOException; import java.io.UncheckedIOException; -import java.net.URLDecoder; import java.nio.file.Path; -import java.text.Normalizer; import java.util.Arrays; import java.util.List; @@ -31,8 +29,6 @@ import org.junit.jupiter.api.Test; import org.springframework.core.io.Resource; import org.springframework.util.StringUtils; -import static java.nio.charset.StandardCharsets.UTF_8; -import static java.text.Normalizer.Form.NFC; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -107,30 +103,6 @@ class PathMatchingResourcePatternResolverTests { } - @Nested - class ContainingJapaneseCharactersInTheirPathsAndFileNames { - - @Test - void usingClasspathStarProtocol() { - String pattern = "classpath*:example/japanese/バリューオブジェクト/**/*.class"; - String pathPrefix = ".+example/japanese/"; - - assertExactFilenames(pattern, "バリューオブジェクト.class"); - assertExactSubPaths(pattern, pathPrefix, "バリューオブジェクト/バリューオブジェクト.class"); - } - - @Test - void usingFilePrototol() { - Path testResourcesDir = Path.of("src/test/resources").toAbsolutePath(); - String pattern = String.format("file:%s/japanese-resources/バリューオブジェクト/**/*.text", testResourcesDir); - String pathPrefix = ".+japanese-resources/"; - - assertExactFilenames(pattern, "バリューオブジェクト.text"); - assertExactSubPaths(pattern, pathPrefix, "バリューオブジェクト/バリューオブジェクト.text"); - } - - } - } @@ -207,31 +179,4 @@ class PathMatchingResourcePatternResolverTests { } } - private void assertExactSubPaths(String pattern, String pathPrefix, String... subPaths) { - try { - Resource[] resources = resolver.getResources(pattern); - List actualSubPaths = Arrays.stream(resources) - .map(resource -> getPath(resource).replaceFirst(pathPrefix, "")) - // TODO Remove URL-decoding and Unicode normalization. - // https://github.com/spring-projects/spring-framework/issues/29243 - .map(path -> URLDecoder.decode(path, UTF_8)) - .map(path -> Normalizer.normalize(path, NFC)) - .sorted() - .toList(); - assertThat(actualSubPaths).containsExactlyInAnyOrder(subPaths); - } - catch (IOException ex) { - throw new UncheckedIOException(ex); - } - } - - private String getPath(Resource resource) { - try { - return resource.getURL().getPath(); - } - catch (IOException ex) { - throw new UncheckedIOException(ex); - } - } - } diff --git a/spring-core/src/test/resources/japanese-resources/バリューオブジェクト/バリューオブジェクト.text b/spring-core/src/test/resources/japanese-resources/バリューオブジェクト/バリューオブジェクト.text deleted file mode 100644 index 22c1978ca39..00000000000 --- a/spring-core/src/test/resources/japanese-resources/バリューオブジェクト/バリューオブジェクト.text +++ /dev/null @@ -1 +0,0 @@ -value object \ No newline at end of file diff --git a/src/checkstyle/checkstyle-suppressions.xml b/src/checkstyle/checkstyle-suppressions.xml index b5c39f26da9..b8e2a43db49 100644 --- a/src/checkstyle/checkstyle-suppressions.xml +++ b/src/checkstyle/checkstyle-suppressions.xml @@ -43,8 +43,6 @@ - -