RFR: JDK-8318671: Potential uninitialized uintx value after JDK-8317683 [v4]

Thomas Stuefe stuefe at openjdk.org
Mon Oct 30 10:35:31 UTC 2023


On Mon, 30 Oct 2023 10:22:06 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

> Ouch, I just realized that we can't differentiate between being provided with the literal number 2 and `MemStatAction::print` anymore since you moved the literal number parsing into this function. That means that we can't set `print_final_memstat_report` after returning from this function.

Yes, its a big annoyance with unnecessary  templatization in this file. The natural point of "print_final.." would be in register_command, but I cannot (easily) query values there because value is T. So I cannot just do a "if type is uintx and option is Memstat and value is print then do xxx".

This code would gain IMHO by being dumbed down. A multi-type value can just as well be expressed with a union, no templates needed. Especially since we keep the type info around at runtime anyway.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16335#discussion_r1375991179


More information about the serviceability-dev mailing list