Browse Source

Merge branch '6.0.x'

pull/30820/head
Juergen Hoeller 1 year ago
parent
commit
420255373d
  1. 2
      spring-core/src/main/java/org/springframework/core/io/PathResource.java
  2. 8
      spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java

2
spring-core/src/main/java/org/springframework/core/io/PathResource.java

@ -303,7 +303,7 @@ public class PathResource extends AbstractResource implements WritableResource {
} }
/** /**
* This implementation returns the hash code of the underlying Path reference. * This implementation returns the hash code of the underlying {@link Path} reference.
*/ */
@Override @Override
public int hashCode() { public int hashCode() {

8
spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java

@ -937,10 +937,10 @@ class ObjectUtilsTests {
@Test @Test
void nullSafeConciseToStringForFile() { void nullSafeConciseToStringForFile() {
String path = "/tmp/file.txt"; String path = "/tmp/file.txt".replace('/', File.separatorChar);
assertThat(ObjectUtils.nullSafeConciseToString(new File(path))).isEqualTo(path); 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))) assertThat(ObjectUtils.nullSafeConciseToString(new File(path)))
.hasSize(truncatedLength) .hasSize(truncatedLength)
.startsWith(path.subSequence(0, 100)) .startsWith(path.subSequence(0, 100))
@ -949,10 +949,10 @@ class ObjectUtilsTests {
@Test @Test
void nullSafeConciseToStringForPath() { void nullSafeConciseToStringForPath() {
String path = "/tmp/file.txt"; String path = "/tmp/file.txt".replace('/', File.separatorChar);
assertThat(ObjectUtils.nullSafeConciseToString(Path.of(path))).isEqualTo(path); 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))) assertThat(ObjectUtils.nullSafeConciseToString(Path.of(path)))
.hasSize(truncatedLength) .hasSize(truncatedLength)
.startsWith(path.subSequence(0, 100)) .startsWith(path.subSequence(0, 100))

Loading…
Cancel
Save