RFR: 7903328: Introduce a new method 'clear' in interface 'Multiset'

Aleksey Shipilev shade at openjdk.org
Mon Sep 26 08:15:49 UTC 2022


On Sun, 25 Sep 2022 15:10:18 GMT, Guoxiong Li <gli at openjdk.org> wrote:

> Hi all,
> 
> This patch adds a method named `clear` in interface `Multset` and implements the method in its sub-class. A corresponding test case is added and all the test passed locally.
> 
> Thanks for taking the time to review.
> 
> Best Regards,
> -- Guoxiong

Little comment, otherwise looks good.

jmh-core/src/main/java/org/openjdk/jmh/util/DelegatingMultiset.java line 112:

> 110:     public void clear() {
> 111:         size = 0;
> 112:         if (map != null) {

I don't think `map` can be `null` here. You can skip the null check.

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

PR: https://git.openjdk.org/jmh/pull/81


More information about the jmh-dev mailing list