RFR: CODETOOLS-7902829: JMH Statistics implementations do not follow Comparable spec [v3]

Aleksey Shipilev shade at openjdk.java.net
Thu Feb 18 13:18:08 UTC 2021


On Thu, 18 Feb 2021 13:10:54 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> jmh-core/src/test/java/org/openjdk/jmh/util/TestListStatistics.java line 190:
>> 
>>> 188:         for (double conf : new double[] {0.5, 0.9, 0.99, 0.999, 0.9999, 0.99999}) {
>>> 189:             Assert.assertTrue("Diff significant at " + conf, s1.isDifferent(s2, conf));
>>> 190:             Assert.assertEquals(-1, s1.compareTo(s2, conf));
>> 
>> Technically speaking, the assert should be `less than 0` rather than `equal to -1`.
>> `-2` is a valid result of `compareTo` call.
>> 
>> WDYT?
>
> You need to press the checkbox in the comment to let me see the comment. But I guess what it says...

Yes, true. Fixed in the new commit.

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

PR: https://git.openjdk.java.net/jmh/pull/21


More information about the jmh-dev mailing list