May need to use toJSONString on @Param values
Aleksey Shipilev
shade at redhat.com
Tue Jan 15 15:37:22 UTC 2019
On 1/7/19 4:01 PM, Will Reichert wrote:
> The json output format breaks when a @Param value contains a [ or {.
> The issue exists in 1.21 and 1.22-SNAPSHOT (built from master)
> I was able to fix it by changing line 195
> in ./jmh-core/src/main/java/org/openjdk/jmh/results/format/JSONResultFormat.java
> to the following
> sb.append(toJsonString(params.getParam(k)));
This change is trivial, but not entirely complete. There are other quoting issues to be fixed, for
example the "value", and it concerns other result formats too. Tests need to be changed carefully
too. Hopefully I got everything right here:
https://bugs.openjdk.java.net/browse/CODETOOLS-7902359
http://hg.openjdk.java.net/code-tools/jmh/rev/a180846b4cb2
Can you verify it with rebuilt 1.22-SNAPSHOT?
> What is the best way to propose this change to JSONResultFormat?
Reporting here is fine.
If you are willing to contribute larger patches to JMH, you need:
a) Sign the OCA, as per http://openjdk.java.net/contribute/
b) Put the patch somewhere on OpenJDK infra. Posting the simple patch in-line in this message (as
you did) would be good enough.
-Aleksey
More information about the jmh-dev
mailing list