src/jdk.attach/solaris/classes/sun/tools/attach/VirtualMachineImpl.java
changeset 57844 3bc26ffdf001
parent 55685 56b96d234f26
child 58679 9c3209ff7550
--- a/src/jdk.attach/solaris/classes/sun/tools/attach/VirtualMachineImpl.java	Thu Aug 22 10:43:25 2019 -0400
+++ b/src/jdk.attach/solaris/classes/sun/tools/attach/VirtualMachineImpl.java	Thu Aug 22 10:40:34 2019 -0700
@@ -60,8 +60,11 @@
         int pid;
         try {
             pid = Integer.parseInt(vmid);
+            if (pid < 1) {
+                throw new NumberFormatException();
+            }
         } catch (NumberFormatException x) {
-            throw new AttachNotSupportedException("Invalid process identifier");
+            throw new AttachNotSupportedException("Invalid process identifier: " + vmid);
         }
 
         // Opens the door file to the target VM. If the file is not