Merge branch '6.0.x'

This commit is contained in:
Juergen Hoeller 2023-07-04 16:53:17 +02:00
commit 420255373d
2 changed files with 5 additions and 5 deletions

View File

@ -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
public int hashCode() {

View File

@ -937,10 +937,10 @@ class ObjectUtilsTests {
@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 @@ class ObjectUtilsTests {
@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))