@Param support for enum
Aleksey Shipilev
aleksey.shipilev at oracle.com
Thu Jun 5 20:45:01 UTC 2014
Hi Joe,
On 06/06/2014 12:02 AM, Joe Kearney wrote:
> The only sensible place to expand the set of values seems to be in
> Runner#explodeAllParams, as you pointed to, generating a BenchmarkRecord
> for each value. In order to get the enum constants we'll need a handle
> on the type token of the enum, which we can get through the type of the
> field, which we can get through the type of the benchmark class.
I only pointed to Runner#explodeAllParams as the place where you would
need to place a runtime check for empty arguments (remember we were
talking about redoing the "default" parameters contracts). However, you
may just do the checks during the compilation in
StateObjectHandler#checkParams.
I would think the better place to treat enums would be to read the
default parameters' values during the generation, pretending as if the
user listed all the values in the annotation explicitly. Here:
http://hg.openjdk.java.net/code-tools/jmh/file/6ee04bc18969/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java#l445
Thanks,
-Aleksey.
More information about the jmh-dev
mailing list