Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8361013

JMH does not export sufficient modules to benchmark ImageReader

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • None
    • infrastructure

      While trying to benchmark src/java.base/share/classes/jdk/internal/jimage/ImageReader.java
      I cannot compile code which uses APIs in either:
      * java.base/jdk.internal.jimage
      * java.base/jdk.internal.jrtfs

      This can be fixed by adding the following lines to make/test/BuildMicrobenchmark.gmk (line 95 or so):

              --add-exports java.base/jdk.internal.jimage=ALL-UNNAMED \
              --add-exports java.base/jdk.internal.jrtfs=ALL-UNNAMED \

      Ideally a better mechanism to determine the necessary exports by parsing the annotations in the benchmark source code, or just exporting all modules, would avoid people getting stuck on this in future (the build failure is opaque and hard to diagnose).

            dabeaumo David Beaumont
            dabeaumo David Beaumont
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: