On Fri, 6 Sep 2024 13:39:43 GMT, Chen Liang <li...@openjdk.org> wrote:
>> The test fails if the method does not throw an exception or throws anything >> other than a NPE. That's why I added `requireNonNull` here. >> >> What exceptions would be considered ok when nulls are provided? > > I think we should prefer NPE instead of IAE for null inputs. > > I think we should just remove this method - the format for composite > list/array or annotation is not well-defined. We might replace this with a > `ofResolvedConstant` to accept primitives and String. API method removal is not subject of this bug/PR, please discuss it on the mailing list. Also throwing NPE instead of IAE is a subject for consideration, as it is a factory of AnnotationValue from an Object, where null might be considered as IAE. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20556#discussion_r1747156753