Throw AssertionError when URISyntaxException happens at findTargetProcessTmpDirectory()

This commit is contained in:
Yasumasa Suenaga 2026-01-25 19:45:59 +09:00
parent c9051cde66
commit 8f11d43ba2

View File

@ -296,7 +296,13 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine {
} }
// Throw original IOE if target process not found on localhost. // Throw original IOE if target process not found on localhost.
throw ioe; throw ioe;
} catch (MonitorException | URISyntaxException e) { } catch (URISyntaxException e) {
// URISyntaxException is defined as a checked exception at
// MonitoredHost.getMonitoredHost() if the URI string poorly
// formed. However "//localhost" is hard-coded at here, so the
// exception should not happen.
throw new AssertionError("Unexpected exception", e);
} catch (MonitorException e) {
// Other exceptions (happened at MonitoredHost) would be wrapped with AttachOperationFailedException // Other exceptions (happened at MonitoredHost) would be wrapped with AttachOperationFailedException
throw new AttachOperationFailedException("Unable to find target proces", e); throw new AttachOperationFailedException("Unable to find target proces", e);
} }