Not strictly Kotlin related, but does anyone know ...
# announcements
k
Not strictly Kotlin related, but does anyone know why the following JMH benchmark code
Copy code
@Fork(1)
@Warmup(iterations = 5, time = 2)
@Measurement(iterations = 5, time = 2)
@State(Scope.Benchmark)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
open class Sha1Benchmark {

}
produces the corresponding error?
Copy code
> Task :okio:jvm:jmh:jmhRunBytecodeGenerator FAILED
Processing 15 classes from /home/kevin/code/okio/okio/jvm/jmh/build/classes/java/jmh with "reflection" generator
Processing 2 classes from /home/kevin/code/okio/okio/jvm/jmh/build/classes/kotlin/jmh with "reflection" generator
Writing out Java source to /home/kevin/code/okio/okio/jvm/jmh/build/jmh-generated-sources and resources to /home/kevin/code/okio/okio/jvm/jmh/build/jmh-generated-resources

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':okio:jvm:jmh:jmhRunBytecodeGenerator'.
> A failure occurred while executing me.champeau.gradle.JmhBytecodeGeneratorRunnable
   > Generation of JMH bytecode failed with 1 errors:
       - Benchmark classes should not be final.
        [com.squareup.okio.benchmarks.Sha1Benchmark]
I'm looking at other examples of JMH benchmarks written in Kotlin and I don't see exactly what I'm doing wrong. My class is marked as
open
. https://github.com/Kotlin/kotlin-benchmarks/blob/master/src/main/kotlin/org/jetbrains/ClassArrayBenchmark.kt