diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java index e6a7b59981..6829eca65c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java @@ -51,7 +51,7 @@ public class Handler extends URLStreamHandler { private static final String CURRENT_DIR = "/./"; - private static final Pattern CURRENT_DIR_PATTERN = Pattern.compile(CURRENT_DIR); + private static final Pattern CURRENT_DIR_PATTERN = Pattern.compile(CURRENT_DIR, Pattern.LITERAL); private static final String PARENT_DIR = "/../"; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/HandlerTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/HandlerTests.java index 4cfacb28ac..52bfa43c91 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/HandlerTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/HandlerTests.java @@ -130,7 +130,7 @@ public class HandlerTests { @Test public void urlWithSpecReferencingParentDirectory() throws MalformedURLException { assertStandardAndCustomHandlerUrlsAreEqual("file:/test.jar!/BOOT-INF/classes!/xsd/folderA/a.xsd", - "../folderB/b.xsd"); + "../folderB/c/d/e.xsd"); } @Test @@ -142,7 +142,7 @@ public class HandlerTests { @Test public void urlWithSpecReferencingCurrentDirectory() throws MalformedURLException { assertStandardAndCustomHandlerUrlsAreEqual("file:/test.jar!/BOOT-INF/classes!/xsd/folderA/a.xsd", - "./folderB/./b.xsd"); + "./folderB/c/d/e.xsd"); } @Test