From 17902c9cec8ec045b02b1983c4776039e8b481f5 Mon Sep 17 00:00:00 2001 From: Tobias Lippert Date: Sun, 21 Jan 2024 17:17:43 +0100 Subject: [PATCH] Remove unnecessary toString calls See gh-39259 --- .../boot/web/servlet/server/StaticResourceJarsTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/StaticResourceJarsTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/StaticResourceJarsTests.java index 231a20a205..8643e81a54 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/StaticResourceJarsTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/StaticResourceJarsTests.java @@ -95,7 +95,7 @@ class StaticResourceJarsTests { void doesNotCloseJarFromCachedConnection() throws Exception { File jarFile = createResourcesJar("test-resources.jar"); TrackedURLStreamHandler handler = new TrackedURLStreamHandler(true); - URL url = new URL("jar", null, 0, jarFile.toURI().toURL().toString() + "!/", handler); + URL url = new URL("jar", null, 0, jarFile.toURI().toURL() + "!/", handler); try { new StaticResourceJars().getUrlsFrom(url); assertThatNoException() @@ -110,7 +110,7 @@ class StaticResourceJarsTests { void closesJarFromNonCachedConnection() throws Exception { File jarFile = createResourcesJar("test-resources.jar"); TrackedURLStreamHandler handler = new TrackedURLStreamHandler(false); - URL url = new URL("jar", null, 0, jarFile.toURI().toURL().toString() + "!/", handler); + URL url = new URL("jar", null, 0, jarFile.toURI().toURL() + "!/", handler); new StaticResourceJars().getUrlsFrom(url); assertThatIllegalStateException() .isThrownBy(() -> ((JarURLConnection) handler.getConnection()).getJarFile().getComment())