Skip to content

Commit 3781ba2

Browse files
committed
Optimize NIO path resolution in PathEditor
Closes gh-35304
1 parent f11a1e6 commit 3781ba2

File tree

1 file changed

+1
-1
lines changed
  • spring-beans/src/main/java/org/springframework/beans/propertyeditors

1 file changed

+1
-1
lines changed

spring-beans/src/main/java/org/springframework/beans/propertyeditors/PathEditor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public void setAsText(String text) throws IllegalArgumentException {
103103
if (resource == null) {
104104
setValue(null);
105105
}
106-
else if (nioPathCandidate && !resource.exists()) {
106+
else if (nioPathCandidate && (!resource.isFile() || !resource.exists())) {
107107
setValue(Paths.get(text).normalize());
108108
}
109109
else {

0 commit comments

Comments
 (0)