Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7901237

Benchmark list is corrupted when incremental compilation is used

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • tools
    • None
    • jmh

      As reported here:
        http://mail.openjdk.java.net/pipermail/jmh-dev/2015-January/001575.html

      I think the reason is:

      IIRC, the "problem" is that annotation processors can be called with the
      subset of files at IDE's discretion, but JMH's BenchmarkGenerator will
      overwrite the benchmark metadata list (META-INF/BenchmarkList) based on
      current annotation processing session. Therefore, if the IDE saves the
      non- at Benchmark file, JMH could end up with empty metadata file.

      > In any case - do you think that JMH can be updated to prevent this? As an
      > option I can imagine that existing file will be updated by JMH instead of
      > overwrite. Do you see any obvious problem with such approach? If not, then
      > I'm willing to work on patch.

      Yes, appending the benchmark line to the metadata file would be an
      (somewhat ugly) option, if javac Filer would allow us to do so. AFAIK,
      it only allows us to "create" (possibly overwriting) the new resource.

      The alternative might be to split the metadata file on per-benchmark
      basis, so that it would be normally overwritten without messing with
      anything else.

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: