src/jdk.attach/macosx/classes/sun/tools/attach/VirtualMachineImpl.java
changeset 57844 3bc26ffdf001
parent 55685 56b96d234f26
child 58679 9c3209ff7550
equal deleted inserted replaced
57842:abf6ee4c477c 57844:3bc26ffdf001
    57 
    57 
    58         // This provider only understands pids
    58         // This provider only understands pids
    59         int pid;
    59         int pid;
    60         try {
    60         try {
    61             pid = Integer.parseInt(vmid);
    61             pid = Integer.parseInt(vmid);
       
    62             if (pid < 1) {
       
    63                 throw new NumberFormatException();
       
    64             }
    62         } catch (NumberFormatException x) {
    65         } catch (NumberFormatException x) {
    63             throw new AttachNotSupportedException("Invalid process identifier");
    66             throw new AttachNotSupportedException("Invalid process identifier: " + vmid);
    64         }
    67         }
    65 
    68 
    66         // Find the socket file. If not found then we attempt to start the
    69         // Find the socket file. If not found then we attempt to start the
    67         // attach mechanism in the target VM by sending it a QUIT signal.
    70         // attach mechanism in the target VM by sending it a QUIT signal.
    68         // Then we attempt to find the socket file again.
    71         // Then we attempt to find the socket file again.