[jdk17u-dev] RFR: 8286781: Replace the deprecated/obsolete gethostbyname and inet_addr calls

Andrew John Hughes andrew at openjdk.org
Wed May 22 15:31:10 UTC 2024


On Tue, 21 May 2024 15:49:26 GMT, fitzsim <duke at openjdk.org> wrote:

> I propose backporting the fix for `8286781` to `jdk17u`.
> 
> I tested the changes on `jdk17u-dev` `master`, on `Fedora 38` `x86-64`, `slowdebug` and `fastdebug` configurations.  The test was to run `IdealGraphVisualizer`, per `jdk17u-dev/src/utils/IdealGraphVisualizer/README.md`, then run, e.g.:
> 
> 
> ./build/linux-x86_64-server-fastdebug/jdk/bin/java -XX:+PrintIdealGraph -XX:PrintIdealGraphLevel=1 -classpath ~/source/hello-java Hello
> 
> 
> I needed extra JVM arguments in `jdk17u-dev/src/utils/IdealGraphVisualizer/application/target/idealgraphvisualizer/bin/idealgraphvisualizer` to make the visualizer utility work on 17:
> 
> 
>             --jdkhome '"$jdkhome"' \
>             -J--add-opens=java.base/java.net=ALL-UNNAMED \
>             -J--add-opens=java.base/java.security=ALL-UNNAMED \
>             -J--add-opens=java.base/java.lang=ALL-UNNAMED \
>             -J--add-opens=java.desktop/sun.awt=ALL-UNNAMED \
>             -J--add-opens=java.desktop/javax.swing.plaf.synth=ALL-UNNAMED \
>             -J--add-opens=java.desktop/javax.swing=ALL-UNNAMED \
>             -J--add-exports=java.desktop/com.sun.java.swing.plaf.gtk=ALL-UNNAMED \
>             --clusters '"$clusters"' \
> 
> 
> Networking between the test and the utility worked fine with the backport applied.

Backport is mostly clean. The changes to remove `-D_WINSOCK_DEPRECATED_NO_WARNINGS` from `make/autoconf/flags-cflags.m4` is absent, as [JDK-8286262](https://bugs.openjdk.org/browse/JDK-8286262) is not present in 17u and it doesn't make sense to backport this kind of change. The only other difference is the `nullptr` vs `NULL` in some of the removed code, which again it doesn't make sense to backport to LTS releases.

As regards running the tool, you may want to look at backporting [JDK-8279068](https://bugs.openjdk.org/browse/JDK-8279068). Despite the title "IGV: Update to work with JDK 16 and 17", it was only added to 19 and later. I can't comment on the other Maven changes in there, but I do see the `add-opens` changes being added.

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

Marked as reviewed by andrew (Reviewer).

PR Review: https://git.openjdk.org/jdk17u-dev/pull/2487#pullrequestreview-2071617754
PR Comment: https://git.openjdk.org/jdk17u-dev/pull/2487#issuecomment-2125088264


More information about the jdk-updates-dev mailing list