RFR: 7903321: Use a set instead of a map to record methods in class 'MethodGroup' [v2]
Aleksey Shipilev
shade at openjdk.org
Wed Sep 21 11:17:07 UTC 2022
On Wed, 21 Sep 2022 11:10:28 GMT, Guoxiong Li <gli at openjdk.org> wrote:
>> jmh-core/src/main/java/org/openjdk/jmh/generators/core/MethodGroup.java line 78:
>>
>>> 76: throw new GenerationException(
>>> 77: "@" + Benchmark.class.getSimpleName() + " method is duplicate with " +
>>> 78: mi.method.getQualifiedName() + ". JMH needs an uniquely named method, regardless of the arguments list. ",
>>
>> Aha! Now I remember why it was `Map` -- we needed `exist` here. But we can also simplify the diagnostics. Say, for example:
>>
>>
>> throw new GenerationException(
>> "Duplicate @" + Benchmark.class.getSimpleName() + " method name: " +
>> mi.method.getQualifiedName() + ". JMH needs an uniquely named method, regardless of the arguments list. ",
>>
>>
>> This would probably need test adjustments that might expect different error message.
>
> I found a corresponding test case `jmh-core-ct/src/test/java/org/openjdk/jmh/ct/benchmark/args/ArgumentListAmbiguityTest`. Any other test cases do you think need to be adjusted?
Current build and GHA run full suite of tests. So, if no other tests are failing, no other tests need adjustment.
-------------
PR: https://git.openjdk.org/jmh/pull/79
More information about the jmh-dev
mailing list