RFR: 7903908: JMH: Helpful message when benchmark builds are misconfigured

Aleksey Shipilev shade at openjdk.org
Thu Dec 12 12:25:24 UTC 2024


When JMH benchmark project is misconfigured, the runner would print an unhelpful error like:


Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList
at org.openjdk.jmh.runner.AbstractResourceReader.getReaders(AbstractResourceReader.java:98)
at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:124)
at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:252)
at org.openjdk.jmh.runner.Runner.run(Runner.java:208)
at org.openjdk.jmh.Main.main(Main.java:71)


This is especially often when JDK 23 disabled annotation processors by default. We need to print more helpful message to guide users to resolution.

-------------

Commit messages:
 - Fix

Changes: https://git.openjdk.org/jmh/pull/143/files
  Webrev: https://webrevs.openjdk.org/?repo=jmh&pr=143&range=00
  Issue: https://bugs.openjdk.org/browse/CODETOOLS-7903908
  Stats: 59 lines in 1 file changed: 28 ins; 21 del; 10 mod
  Patch: https://git.openjdk.org/jmh/pull/143.diff
  Fetch: git fetch https://git.openjdk.org/jmh.git pull/143/head:pull/143

PR: https://git.openjdk.org/jmh/pull/143


More information about the jmh-dev mailing list