Integrated: 8371953: Document null handling in core reflection APIs

Chen Liang liach at openjdk.org
Fri Nov 21 00:48:57 UTC 2025


On Sat, 15 Nov 2025 23:04:53 GMT, Chen Liang <liach at openjdk.org> wrote:

> A lot of core reflection APIs are from antique times, which have their own null handling behavior. Such behaviors are often not documented in the specification; we should document rejected null arguments and accepted null arguments (including array elements) explicitly.
> 
> In the investigation, I found `Class.isNestmateOf` (inconsistent) and `AnnotatedType`'s implementation of `AnnotatedElement` methods (required by specification) are missing null checks. I consider these unlikely to be a user dependency and added new null checks.

This pull request has now been integrated.

Changeset: 2358d40c
Author:    Chen Liang <liach at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/2358d40cbcafb851425176cacf65cc3be1ae12a2
Stats:     456 lines in 16 files changed: 405 ins; 16 del; 35 mod

8371953: Document null handling in core reflection APIs

Reviewed-by: alanb

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

PR: https://git.openjdk.org/jdk/pull/28336


More information about the core-libs-dev mailing list