diff --git a/spring-core/src/main/java/org/springframework/core/io/PathResource.java b/spring-core/src/main/java/org/springframework/core/io/PathResource.java index c4a4168b2ee9..b4edc9bbf470 100644 --- a/spring-core/src/main/java/org/springframework/core/io/PathResource.java +++ b/spring-core/src/main/java/org/springframework/core/io/PathResource.java @@ -303,7 +303,7 @@ public boolean equals(@Nullable Object obj) { } /** - * This implementation returns the hash code of the underlying Path reference. + * This implementation returns the hash code of the underlying {@link Path} reference. */ @Override public int hashCode() { diff --git a/spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java b/spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java index 025c3a99f5c3..1bbd0f9e92d0 100644 --- a/spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java @@ -937,10 +937,10 @@ void nullSafeConciseToStringForUUID() { @Test void nullSafeConciseToStringForFile() { - String path = "/tmp/file.txt"; + String path = "/tmp/file.txt".replace('/', File.separatorChar); assertThat(ObjectUtils.nullSafeConciseToString(new File(path))).isEqualTo(path); - path = "/tmp/" + "xyz".repeat(32); + path = ("/tmp/" + "xyz".repeat(32)).replace('/', File.separatorChar); assertThat(ObjectUtils.nullSafeConciseToString(new File(path))) .hasSize(truncatedLength) .startsWith(path.subSequence(0, 100)) @@ -949,10 +949,10 @@ void nullSafeConciseToStringForFile() { @Test void nullSafeConciseToStringForPath() { - String path = "/tmp/file.txt"; + String path = "/tmp/file.txt".replace('/', File.separatorChar); assertThat(ObjectUtils.nullSafeConciseToString(Path.of(path))).isEqualTo(path); - path = "/tmp/" + "xyz".repeat(32); + path = ("/tmp/" + "xyz".repeat(32)).replace('/', File.separatorChar); assertThat(ObjectUtils.nullSafeConciseToString(Path.of(path))) .hasSize(truncatedLength) .startsWith(path.subSequence(0, 100))