RFR: 8282917: Remove InetAddressImplFactory from InetAddress

Jaikiran Pai jpai at openjdk.java.net
Wed Mar 16 13:59:45 UTC 2022


On Wed, 16 Mar 2022 13:26:36 GMT, Aleksei Efimov <aefimov at openjdk.org> wrote:

> Hi,
> 
> This cleanup change removes `InetAddressImplFactory` class from `InetAddress`. The list of changes:
> - Remove `InetAddressImplFactory` from `InetAddress`
> - Since `isIPv6Supported` native code is identical for Windows and Unix implementations it was moved to the libnet's `InetAddress.c`.
> - `InetAddressImplFactory.c` Windows and Unix implementations were removed
> 
> Testing: jdk-tier1 to jdk-tier3 tests show no failures related to the change

src/java.base/share/native/libnet/InetAddress.c line 96:

> 94:     } else {
> 95:         return JNI_FALSE;
> 96:     }

I don't have knowledge of C or JNI, but the `Java_java_net_InetAddress_isIPv4Available` currently does:


return ipv4_available();

So maybe a similar construct can be used here instead of if/else blocks? I'm guessing `ipv6_available()` will be returning values that are compatible with `JNI_TRUE/JNI_FALSE`.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7842


More information about the net-dev mailing list