JDK-8285500 : cannot open file "NUL:"
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.io
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 7-pool,8-pool,11-pool,13-pool,15-pool,17-pool,18-pool,19
  • Submitted: 2022-04-23
  • Updated: 2022-04-28
  • Resolved: 2022-04-23
Related Reports
CSR :  
Description
Summary
-------

Change the default value of the Windows-specific property `jdk.io.File.enableADS` from `false` to `true` thereby permitting by default certain characters in Windows file paths in `java.io`.

Problem
-------

The default value of the `jdk.io.File.enableADS` system property is currently `false` which breaks some applications which depend on being able to use certain characters in Windows file paths.

Solution
--------

Change the default value of the `jdk.io.File.enableADS` system property from `false` to `true`.

Specification
-------------

There is no visible specification change.

    --- a/src/java.base/windows/classes/java/io/WinNTFileSystem.java
    +++ b/src/java.base/windows/classes/java/io/WinNTFileSystem.java
    @@ -48,16 +48,15 @@ class WinNTFileSystem extends FileSystem {
     
         // Whether to enable alternative data streams (ADS) by suppressing
         // checking the path for invalid characters, in particular ":".
    -    // ADS support will be enabled if and only if the property is set and
    -    // is the empty string or is equal, ignoring case, to the string "true".
    -    // By default ADS support is disabled.
    +    // By default, ADS support is enabled and will be disabled if and
    +    // only if the property is set, ignoring case, to the string "false".
         private static final boolean ENABLE_ADS;
         static {
             String enableADS = GetPropertyAction.privilegedGetProperty("jdk.io.File.enableADS");
             if (enableADS != null) {
    -            ENABLE_ADS = "".equals(enableADS) || Boolean.parseBoolean(enableADS);
    +            ENABLE_ADS = !enableADS.equalsIgnoreCase(Boolean.FALSE.toString());
             } else {
    -            ENABLE_ADS = false;
    +            ENABLE_ADS = true;
             }
         }


Comments
Great, thank you!
28-04-2022

[~yan], attended 13-pool.
28-04-2022

Ouch! I have missed a moment. Would it be possible to approve for 13-pool as well? It is as affected as any on the approved list.
27-04-2022

Thank you.
25-04-2022

Approving for additional release trains.
25-04-2022

This CSR was approved for 8/11/18 and 19. I would like to request the same change for 15/17. Should I create a new CSR or this one can be updated?
25-04-2022