@Param support for enum

Aleksey Shipilev aleksey.shipilev at oracle.com
Sat Jun 14 18:38:26 UTC 2014


(on vacation, asking briefly)

In JMH 0.9+, @Param(<enum>) already has the value set with all enum constants. Are you saying you want parameter-less @Param(<boolean>) to implicitly have ("false", "true") value set?

-Aleksey

On 14.06.2014, at 17:44, Martin Grajcar <maaartinus at gmail.com> wrote:

> Hi!
> 
> FWIW parameterless @Param annotations are what I always to use with
> Caliper. Ideally, I pack the variants into an enum and use some booleans,
> too. Then I get something like
> 
> @Param
> private MemoizationType memoizationType;
> @Param
> private boolean prefixed;
> 
> with no need to repeat the values (and no chance of forgetting to update
> the list when something changes!). See [1] for a complete example.
> 
> Would you say that I'm doing something strange?
> 
> [1]:
> https://dl.dropboxusercontent.com/u/4971686/published/maaartin/lombok/CachedHashCodeBenchmark.java
> 
> PS: Joe: Sorry for the previous email, it was meant to go to the list.


More information about the jmh-dev mailing list