jmh-gradle-plugin icon indicating copy to clipboard operation
jmh-gradle-plugin copied to clipboard

Use List instead of ListProperty for `benchmarkParameters` values

Open jrhee17 opened this issue 3 years ago • 0 comments

Motivation

ex) https://github.com/line/armeria/pull/3811

It seems like most usages assume that the parameter values are List rather than ListProperty ref: https://github.com/search?l=Gradle&p=5&q=benchmarkParameters&type=Code

Using previous code naively, the following exception is raised:

> Error while evaluating property 'benchmarkParameters' of task ':benchmarks:jmh'
   > Failed to calculate the value of task ':benchmarks:jmh' property 'benchmarkParameters'.
      > Failed to query the value of extension 'jmh' property 'benchmarkParameters'.
         > Cannot get the value of a property of type java.util.Map with value type org.gradle.api.provider.ListProperty as the source contains a value of type java.util.ArrayList.

A workaround exists so I wouldn't say this is critical, but I was wondering if this API change was intentional.

Modification

  • Modify addMapOption to receive a List value instead of a ListProperty value

jrhee17 avatar Sep 04 '21 05:09 jrhee17