[jdk17u-dev] RFR: 8290499: new File(parent, "/") breaks normalization – creates File with slash at the end

Roland Mesde duke at openjdk.org
Fri Nov 14 20:40:35 UTC 2025


On Wed, 12 Nov 2025 18:49:35 GMT, Roland Mesde <duke at openjdk.org> wrote:

> Backporting JDK-8290499: New File(parent, "/") breaks normalization – creates File with slash at the end. Fixes the file separator logic and updates a test. Ran GHA Sanity Checks (passed), and related file tests (passed). Patch is clean.

Risk Mitigation:
• Cross-platform testing completed successfully
• Issue is deterministic and well-understood
• Fix addresses core path normalization logic
• No breaking changes to existing API

Potential Risk:
• File system operations - Applications relying on exact path strings may be affected
• Path comparison logic - Code comparing file paths as strings could break
• Legacy compatibility - Existing workarounds for double slashes might become redundant

Impact Areas:
• File I/O operations using constructed paths
• Path-based caching or indexing systems  
• Configuration files with hardcoded path expectations
• Third-party libraries expecting specific path formats

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

PR Comment: https://git.openjdk.org/jdk17u-dev/pull/4175#issuecomment-3534480574


More information about the jdk-updates-dev mailing list