From 49c91b7f9522a991bcac789b9fcccfee8bf08b5d Mon Sep 17 00:00:00 2001
From: Yasumasa Suenaga <ysuenaga@openjdk.org>
Date: Mon, 28 Jan 2019 08:01:06 +0900
Subject: [PATCH] 8217850: CompressedClassSpaceSizeInJmapHeap fails after
 JDK-8217612

Reviewed-by: dholmes, cjplummer
---
 .../share/classes/sun/jvm/hotspot/tools/HeapSummary.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
index d3c3827b79a..68adb87043c 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -294,6 +294,8 @@ public class HeapSummary extends Tool {
       if (f != null) {
          if (f.isBool()) {
             return f.getBool()? 1L : 0L;
+         } else if (f.isUIntx() || f.isSizet() || f.isUint64t()) {
+            return Long.parseUnsignedLong(f.getValue());
          } else {
             return Long.parseLong(f.getValue());
          }