RFR: 8332287: When printing arguments in error logs, quote arguments with whitespaces [v2]
Thomas Stuefe
stuefe at openjdk.org
Sat May 18 05:20:06 UTC 2024
On Fri, 17 May 2024 14:22:23 GMT, Kevin Walls <kevinw at openjdk.org> wrote:
> > But how would I know the original?
>
> I don't think you can. 8-) That may be why it's currently done as it is, if the quote placement is lost we just can't put it back and know it was correct.
>
> This next one may be a bit artificial, but we should also at least acknowledge the case where an argument has an embedded quote character, e.g. escaped with a backslash before I type it. There might be an XX or other option where that could apply at some point. You don't get a String you can paste, unless we escape quotes when printing in print_jvm_args_on(). And we don't want to make that much more complicated. We can either print the escape \ before any quotes, or just note in the bug that this is not always a trivial problem, although it is trivial for many cases.
How deep down the rabbit hole do we go? Escape both single- and double-quotes? What if they are already escaped?
Tbh, I would have liked this to be a small patch without burning too much time on it. I think what you describe is a rare outlier case (arguments that contain both whitespaces and quotes). Wheras the spaces-in-arguments is something that regularly occurs during many jtreg tests.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19248#issuecomment-2118646010
More information about the hotspot-runtime-dev
mailing list