changeset 26806:4e6fbf9f59f4

8058479: serviceability/dcmd/CodeCacheTest.java fails Summary: Don't parse really large hex values into a long Reviewed-by: kvn, anoll
author neliasso
date Fri, 19 Sep 2014 10:31:03 +0200
parents 73f3e9ac86f5
children b2a4db3243d6
files hotspot/test/serviceability/dcmd/CodeCacheTest.java
diffstat 1 files changed, 7 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/test/serviceability/dcmd/CodeCacheTest.java	Thu Sep 18 09:37:26 2014 +0200
+++ b/hotspot/test/serviceability/dcmd/CodeCacheTest.java	Fri Sep 19 10:31:03 2014 +0200
@@ -80,22 +80,15 @@
         line = r.readLine();
         m = line2.matcher(line);
         if (m.matches()) {
-            long start = Long.parseLong(m.group(1), 16);
-            if (start < 0) {
+            String start = m.group(1);
+            String mark  = m.group(2);
+            String top   = m.group(3);
+
+            // Lexical compare of hex numbers to check that they look sane.
+            if (start.compareTo(mark) > 1) {
                 throw new Exception("Failed parsing dcmd codecache output");
             }
-            long mark = Long.parseLong(m.group(2), 16);
-            if (mark < 0) {
-                throw new Exception("Failed parsing dcmd codecache output");
-            }
-            long top = Long.parseLong(m.group(3), 16);
-            if (top < 0) {
-                throw new Exception("Failed parsing dcmd codecache output");
-            }
-            if (start > mark) {
-                throw new Exception("Failed parsing dcmd codecache output");
-            }
-            if (mark > top) {
+            if (mark.compareTo(top) > 1) {
                 throw new Exception("Failed parsing dcmd codecache output");
             }
         } else {