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

Remove "impl.prefix" jdk system property usage from InetAddress

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 18
    • core-libs
    • None
    • behavioral
    • low
    • It is unlikely that this property is still used with strong encapsulation in place
    • System or security property
    • JDK

      Summary

      Remove obsolete usage of the undocumented "impl.prefix" JDK system property from InetAddress.

      Problem

      The InetAddress class uses "impl.prefix" JDK internal system property to locate and install classes which implement "java.net.InetAddressImpl" package private interface.

      This mechanism allows replacing built-in implementations used by InetAddress. The following built-in implementations are used by default:
      java.net.Inet4AddressImpl and java.net.Inet6AddressImpl.

      To replace the built-in implementations the custom class should be located in 'java.net.' package and its full name is constructed from "impl.prefix" value by following this rule:
      "java.net." + value + implName
      Where implName is either "Inet6AddressImpl" or "Inet4AddressImpl".

      With strong encapsulation this logic is obsolete and can be removed.

      Solution

      • Remove "impl.prefix" property usage in InetAddress.
      • Seal internal java.net.InetAddressImpl interface to permit only java.net.Inet4AddressImpl and java.net.Inet6AddressImpl implementations.
      • A release note is planned for this change.

      Specification

      The webrev with changes is attached: JDK-8274227_webrev.zip
      There is no specification changes associated with the proposed change, since all classes are package private in 'java.net' package.

            aefimov Aleksej Efimov
            aefimov Aleksej Efimov
            Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: