RFR: 8317356: Test ClassFile API if it deals with nulls correctly across the whole API [v3]

Nizar Benalla nbenalla at openjdk.org
Fri Sep 6 12:42:52 UTC 2024


On Fri, 6 Sep 2024 09:14:18 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   convert TestNullHostile to use JUnit Jupiter API
>
> src/java.base/share/classes/java/lang/classfile/AnnotationValue.java line 681:
> 
>> 679:      */
>> 680:     static AnnotationValue of(Object value) {
>> 681:         requireNonNull(value);
> 
> Below is a null test throwing IAE.

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?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20556#discussion_r1747059399


More information about the core-libs-dev mailing list