JDK-8253930 : Update to JEP 380 API
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.nio
  • Priority: P4
  • Status: Closed
  • Resolution: Withdrawn
  • Fix Versions: 16
  • Submitted: 2020-10-02
  • Updated: 2020-10-06
  • Resolved: 2020-10-06
Related Reports
CSR :  
Description
Summary
-------

Small update to Unix domain socket channel API.

Problem
-------

Following from the spec change in JDK-8247942, we need to make two small updates.

 1. define a supported JDK specific system/networking property
 2. make a small change to `java.net.UnixDomainSocketAddress`

Solution
--------

See specification

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

A system property called `jdk.nio.unixdomain.tmpdir` is defined by adding the following text to the Unix and Windows versions of `conf/net.properties`

Unix
```
    #
    # Default directory where automatically bound Unix domain server
    # sockets are stored. Sockets are automatically bound when bound
    # with a null address.
    #
    # On Unix the search order to determine this directory is:
    #
    # 1. System property jdk.nio.unixdomain.tmpdir
    #
    # 2. Networking property jdk.nio.unixdomain.tmpdir specified
    #    in this file (effective default)
    #
    # 3. System property java.io.tmpdir
    #
    jdk.nio.unixdomain.tmpdir=/tmp
```
Windows


```
    #
    # Default directory where automatically bound Unix domain server
    # sockets are stored. Sockets are automatically bound when bound
    # with a null address.
    #
    # The search order for the directory on Windows is:
    #
    # 1. System property jdk.nio.unixdomain.tmpdir
    #
    # 2. Networking property jdk.nio.unixdomain.tmpdir specified
    #    in this file (not set by default)
    #
    # 3. The TEMP environment variable (the effective default)
    #
    # 4. The java.io.tmpdir system property
    #
    #jdk.nio.unixdomain.tmpdir=

```

The second change is the following update to `java.net.UnixDomainSocketAddress`

```
    @@ -37,12 +38,12 @@
      * A <a href="package-summary.html#unixdomain">Unix domain</a> socket address.
      * A Unix domain socket address encapsulates a file-system path that Unix domain sockets
      * bind or connect to.
      *
      * <p> An <a id="unnamed"></a><i>unnamed</i> {@code UnixDomainSocketAddress} has
    - * an empty path. The local address of a Unix domain socket that is automatically
    - * bound will be unnamed.
    + * an empty path. The local address of a {@link SocketChannel} to a Unix domain socket
    + * that is <i>automatically</i> or <i>implicitly</i> bound will be unnamed.
      *
      * <p> {@link Path} objects used to create instances of this class must be obtained
      * from the {@linkplain FileSystems#getDefault system-default} file system.
      *
      * @see java.nio.channels.SocketChannel
   
```