JMH problem with State referencing
Michal Cervenansky
mcervena at redhat.com
Wed Nov 25 10:55:01 UTC 2020
Hello,
I have come across a use case where I need to reference class with @State
Scope.Benchmark in class with @State Scope.Thread. This is possible in JMH.
However, when I tried to use it twice, for example in both setup and
teardown methods, then the build failed. I believe it is because parameter
names are generated based on their type, so two parameters of the same type
lead to generating the same parameter name, and that causes the error.
Please see this example, where I showcase the problem as well as how this
feature could be still used:
https://github.com/MichalCervenansky/Demo-JMH-State-Referencing-Problem
May I ask if there are any plans regarding this feature? To either better
document it and hopefully fix the problem I have encountered or it might
get removed in future versions?
Many thanks,
Michal Červeňanský.
More information about the jmh-dev
mailing list