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 onlyjava.net.Inet4AddressImpl
andjava.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.
- csr of
-
JDK-8274227 Remove "impl.prefix" jdk system property usage from InetAddress
- Closed