May need to use toJSONString on @Param values
Will Reichert
willr3 at gmail.com
Tue Jan 15 15:55:38 UTC 2019
I rebuilt a180846b4cb2 and it solves the problem I saw
with @Param({"[broken]","{broken}"})
Thank you for fixing this and finding all the other cases I missed.
--Will
On Tue, Jan 15, 2019 at 9:37 AM Aleksey Shipilev <shade at redhat.com> wrote:
> 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