RFR: 7038838: Unspecified NPE in java.net.IDN methods
Chen Liang
liach at openjdk.org
Fri Nov 29 16:22:54 UTC 2024
On Fri, 29 Nov 2024 16:14:28 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
> Can I please get a review of this doc-only changes which specifies the methods on `java.net.IDN` to throw `NullPointerException` when any argument is null?
>
> This addresses https://bugs.openjdk.org/browse/JDK-7038838. As noted in that issue, the current implementation of these methods already throw a NullPointerException for any null argument. This change now updates the specification to match the current implementation.
>
> A new jtreg test has been added to verify this behaviour. Note that there already was a `test/jdk/java/net/Socket/IDNTest.java` test but looking what that test does, the history of that test and the location of that test in `java/net/Socket` directory made me believe that it's not meant for testing the `java.net.IDN` class. That's why I created this new test class in `test/jdk/java/net/` directory.
>
> I'll draft a CSR for this change.
Note this patch is doc-only and test-only, thus this may be backported to JDK 24 when it enters RDP 1. Looks good, the 4 methods seem to already throw NPE in `isRootLabel`.
-------------
Marked as reviewed by liach (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/22463#pullrequestreview-2470255198
More information about the net-dev
mailing list