RFR: 8319123: Implement JEP 461: Stream Gatherers (Preview) [v8]

Viktor Klang vklang at openjdk.org
Wed Nov 15 17:29:55 UTC 2023


On Wed, 15 Nov 2023 16:40:53 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Viktor Klang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Unpacking the rethrown exceptions from Gatherers.mapConcurrent()
>
> test/jdk/java/util/stream/GathererAPITest.java line 77:
> 
>> 75:             return;
>> 76:         }
>> 77:         fail("Expected NullPointerException but wasn't thrown!");
> 
> If you are updating this test then you could use assertThrows(UnsupportedOperationException.class, supplier::get) here, same in assertThrowsNPE.  It's just a minor thing as I'm reading through some of the tests.

That's a good point. Earlier these utilities did unwrapping to type-test a cause, but how it's written now it can definitely be replaced with an assertThrows.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16420#discussion_r1394527319


More information about the core-libs-dev mailing list