JMC-6256: JMC doesn't respect Long.MIN_VALUE as a missing value

Marcus Hirt marcus.hirt at
Tue Dec 18 11:14:34 UTC 2018

Looks good Alex! Please go ahead!


Kind regards,



From: Alex Macdonald <almacdon at>
Date: Thursday, 13 December 2018 at 22:16
To: Marcus Hirt <marcus.hirt at>, <jmc-dev at>
Subject: Re: JMC-6256: JMC doesn't respect Long.MIN_VALUE as a missing value


Whoops, just realized I hit reply instead of reply-all so this didn't get sent to list, please find attached an updated patch.

On Thu, Dec 13, 2018 at 10:00 AM Alex Macdonald <almacdon at> wrote:

Hi Marcus,


Thanks for the review and suggestion, I've amended the patch to keep the string constants inside TypeHandling.


On Wed, Dec 12, 2018 at 4:48 PM Marcus Hirt <marcus.hirt at> wrote:

Hi Alex,

Quick comment before going to bed:

I don't believe we should externalize Integer.MIN_VALUE etc. They are defined 
in the java core libraries. One could argue for MISSING_VALUE and 
MISSING_VALUE_TOOLTIP to be externalized though.

Kind regards,

On 2018-12-12, 22:10, "jmc-dev on behalf of Alex Macdonald" <jmc-dev-bounces at on behalf of almacdon at> wrote:


    This patch addresses JMC-6256 [0], in which MIN_VALUEs are displayed in
    their numeric form instead of being displayed as a N/A or missing value.
    For testing purposes, I have been using the memoryleak.jfr recording that
    is available as an attachment on JMC-6127 [1].

    As per the comments in the bug report, there are 6 cases to consider for
    missing values in JMC [2]. Additionally, it may be nice to show the actual
    value in parenthesis in the tooltip [3].

    Screenshots (album [4]):
    Before: [5]
    After: [6]

    The culprit here seems to be the way the conditionals in the
    "getValueString()" [7][8] end up processing the value. There is a
    duplication of the "instanceof IDisplayable" in the JfrPropertySheet [7]
    and the TypeHandling [8], and the TypeHandling.getValueString() ends up
    being called anyways in the JfrPropertySheet.getValueString(). As a result,
    the conditional to see if it's an IDisplayable from the JfrPropertySheet
    happens before the conditional to see if it is a min value [9] (which is
    where we want to end up in this case).

    This patch removes the duplicated conditional from the JfrPropertySheet,
    because it is already correctly handled in TypeHandling. Additionally, a
    function "getNumericString" has been introduced for the display of the
    tooltip. If the value is an IQuantity then "getNumericString" will figure
    out which missing value type it is, and display it in the tooltip. If the
    value is an IQuantity but not a missing value, then it delegates to
    TypeHandling.getValueString(). I've also included a quick unit test to
    verify the behaviour of "getNumericString".





More information about the jmc-dev mailing list