Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8253124

JEP-380 : UnixDomainSocketAddress ::of​(Path path) spec amendment

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Withdrawn
    • Icon: P3 P3
    • 16
    • core-libs
    • None
    • minimal
    • Unreleased API
    • Java API
    • SE

      Summary

      Need to specify @throws NullPointerException for two methods in java.net.UnixDomainSocketAddress

      Problem

      The static factory methods of java.net.UnixDomainSocketAddress throw NullPointerException if given null parameters, but this is not specified.

      Solution

      Add @throws to both methods

      Specification

        --- a/src/java.base/share/classes/java/net/UnixDomainSocketAddress.java
        +++ b/src/java.base/share/classes/java/net/UnixDomainSocketAddress.java
        @@ -144,6 +144,9 @@ public final class UnixDomainSocketAddress extends SocketAddress {
              *
              * @throws InvalidPathException
              *         If the path cannot be converted to a Path
        +     *
        +     * @throws NullPointerException
        +     *         If pathname is {@code null}
              */
             public static UnixDomainSocketAddress of(String pathname) {
                 return of(Path.of(pathname));
        @@ -159,6 +162,9 @@ public final class UnixDomainSocketAddress extends SocketAddress {
              *
              * @throws IllegalArgumentException
              *         If the path is not associated with the default file system
        +     *
        +     * @throws NullPointerException
        +     *         If path is {@code null}
              */
             public static UnixDomainSocketAddress of(Path path) {
                 return new UnixDomainSocketAddress(path);

            michaelm Michael McMahon
            kganapureddy Krushnareddy Ganapureddy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: