RFR: 8354450: Using a File with a path containing a trailing space should fail when alternative data streams are disabled (win) [v2]

Alan Bateman alanb at openjdk.org
Wed Apr 16 17:46:48 UTC 2025


On Wed, 16 Apr 2025 17:23:41 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> src/java.base/windows/classes/java/io/WinNTFileSystem.java line 372:
>> 
>>> 370:         int len = pathname.length();
>>> 371:         if (len > 0 && pathname.charAt(len - 1) == ' ')
>>> 372:             return true;
>> 
>> Can you think about "foo \bar" case too?
>
> I am not sure what you mean here as file paths _can_ contain (s) space(s).

The question is about directories in the path that end with space. So yes, the file path may contain spaces but the proposed check is only looking at the end last element.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24635#discussion_r2047427427


More information about the core-libs-dev mailing list