From 3781ba223ed76823b99e9c699e0957b391e22bf9 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 11 Aug 2025 14:32:39 +0200 Subject: [PATCH] Optimize NIO path resolution in PathEditor Closes gh-35304 --- .../org/springframework/beans/propertyeditors/PathEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PathEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PathEditor.java index 3fc5065b599..7b53e70ff3a 100644 --- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PathEditor.java +++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PathEditor.java @@ -103,7 +103,7 @@ public class PathEditor extends PropertyEditorSupport { if (resource == null) { setValue(null); } - else if (nioPathCandidate && !resource.exists()) { + else if (nioPathCandidate && (!resource.isFile() || !resource.exists())) { setValue(Paths.get(text).normalize()); } else {