On Wed, 4 Jan 2023 02:05:38 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> harmless refactor to share code across different platforms of 
>> VirtualMachineImpl:
>> 1. Shared code to process command response after requesting a command 
>> execution
>> 2. Read functionality in SocketInputStream can be reused
>
> src/jdk.attach/aix/classes/sun/tools/attach/VirtualMachineImpl.java line 59:
> 
>> 57: 
>> 58:         // This provider only understands pids
>> 59:         int pid = Integer.parseInt(vmid);
> 
> This will now throw `NumberFormatException` instead of the expected 
> `AttachNotSupportedException`.

The same check is performed in its superclass HotSpotVirtualMachine. So we can 
be sure that it will not throw NumberFormatException and 
AttachNotSupportedException here

https://github.com/openjdk/jdk/blob/38cfc591725de478879266584280562f0ba4b42f/src/jdk.attach/share/classes/sun/tools/attach/HotSpotVirtualMachine.java#L69-L74

-------------

PR: https://git.openjdk.org/jdk/pull/11823

Reply via email to