Infra Params

Alex Averbuch alex.averbuch at neotechnology.com
Fri Jul 8 10:42:06 UTC 2016


I have a minimal example for reproducing this error, it goes like this:

(1) Define @State(Scope.Benchmark) class named Test <--- OK
(2) Define @Benchmark method named nothing() <--- OK
(3) Pass @State instance into @Benchmark method, e.g. public void nothing(
Test test ) <--- ERROR!


The error:

[ERROR]
/Users/me/IdeaProjects/jmh-benchmarks/target/generated-sources/annotations/org/db/bench/core/generated/Test_nothing_jmhTest.java:[390,16]
method setUp in class org.db.bench.core.Test cannot be applied to given
types;
  required: org.openjdk.jmh.infra.BenchmarkParams
  found:
org.openjdk.jmh.infra.generated.BenchmarkParams_jmhType,org.openjdk.jmh.infra.generated.BenchmarkParams_jmhType
  reason: actual and formal argument lists differ in length


The code:

@State( Scope.Benchmark )
public class Test
{
    @Setup
    public void setUp( BenchmarkParams params ){}

    @Benchmark
    public void nothing( Test test ){}
}


More information about the jmh-dev mailing list