diff agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java @ 12932:7fe6ef09d242

8025638: jmap returns 0 instead of 1 when it fails. Summary: Re-factored some code handling return values and fails/errors during tool execution. Reviewed-by: sla, kevinw Contributed-by: fredrik.arvidsson@oracle.com
author farvidsson
date Wed, 16 Oct 2013 09:20:23 +0200
parents 38ea2efa32a7
children
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java	Tue Oct 15 08:25:43 2013 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java	Wed Oct 16 09:20:23 2013 +0200
@@ -136,7 +136,9 @@
                         mode = MODE_HEAP_GRAPH_GXL;
                     } else {
                         System.err.println("unknown heap format:" + format);
-                        return;
+
+                        // Exit with error status
+                        System.exit(1);
                     }
                 } else {
                     copyArgs = false;
@@ -153,8 +155,7 @@
         }
 
         JMap jmap = new JMap(mode);
-        jmap.start(args);
-        jmap.stop();
+        jmap.execute(args);
     }
 
     public boolean writeHeapHprofBin(String fileName) {