RFR: JMC-6256: JMC doesn't respect Long.MIN_VALUE as a missing value
erik.gahlin at oracle.com
Wed Dec 12 22:19:34 UTC 2018
We will add N/A values to ThreadPark and OldObjectSample event for JDK
12, so this will be great!
> This patch addresses JMC-6256 , 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 .
> As per the comments in the bug report, there are 6 cases to consider for
> missing values in JMC . Additionally, it may be nice to show the actual
> value in parenthesis in the tooltip .
> Screenshots (album ):
> Before: https://imgur.com/aoGgzRn 
> After: https://imgur.com/DVnHQGZ 
> The culprit here seems to be the way the conditionals in the
> "getValueString()"  end up processing the value. There is a
> duplication of the "instanceof IDisplayable" in the JfrPropertySheet 
> and the TypeHandling , 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  (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".
>  https://bugs.openjdk.java.net/browse/JMC-6256
>  https://bugs.openjdk.java.net/browse/JMC-6127
>  https://imgur.com/a/3BZNHnG
>  https://imgur.com/aoGgzRn
>  https://imgur.com/DVnHQGZ
More information about the jmc-dev