RFR: JDK-8309550: jdk.jfr.internal.Utils::formatDataAmount method should gracefully handle amounts equal to Long.MIN_VALUE [v2]
Erik Gahlin
egahlin at openjdk.org
Tue Jun 13 13:46:56 UTC 2023
On Wed, 7 Jun 2023 10:07:18 GMT, Frederic Thevenet <fthevenet at openjdk.org> wrote:
>> Please review this simple fix to JDK-8309550.
>>
>> NB: The problem originally reported only concerned `src/jdk.jfr/share/classes/jdk/jfr/internal/Utils.java`, but since this code was duplicated in `src/jdk.jfr/share/classes/jdk/jfr/internal/util/ValueFormatter.java` with, as far as I understood from the bug description, with an intent to refactor it a a later time, I opted to change both occurrences of the method.
>
> Frederic Thevenet has updated the pull request incrementally with one additional commit since the last revision:
>
> Put brackets around the ? condition
JFR uses Long.MIN_VALUE to indicate that a value is not available or not applicable ("N/A"). I think a correct fix should be to check for that before calling the method, or do it in the method.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14341#issuecomment-1589348599
More information about the hotspot-jfr-dev
mailing list