Open burmanm opened 7 years ago
In short your library includes BenchmarkList
file, if you include your project as a dependency in a JMH test it will break the JMH with error:
Exception in thread "main" java.lang.IllegalArgumentException: The length should be multiple of 8
at org.openjdk.jmh.util.lines.Armor.decode(Armor.java:110)
at org.openjdk.jmh.util.lines.TestLineReader.readArmoredString(TestLineReader.java:70)
at org.openjdk.jmh.util.lines.TestLineReader.nextOptionalParamCollection(TestLineReader.java:184)
at org.openjdk.jmh.runner.BenchmarkListEntry.<init>(BenchmarkListEntry.java:129)
at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:135)
at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:260)
at org.openjdk.jmh.runner.Runner.run(Runner.java:209)
at org.openjdk.jmh.Main.main(Main.java:71)
at least when use use JMH 1.2x.
This is probably something that has changed with the newer JMH versions. The BenchmarkList file is created by JMH.
The Benchmark parts are still residing in the main/ section of the source code, while they should be in the test. This causes the jmh-libraries and all its subdependencies to flow to implementing programs.