diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/VMConnection.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/VMConnection.java index 7f4ae6939cb..555e8272e81 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/VMConnection.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/VMConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -544,16 +544,18 @@ class VMConnection { } catch (IOException ioe) { ioe.printStackTrace(); MessageOutput.fatalError("Unable to launch target VM."); + throw new RuntimeException(ioe); } catch (IllegalConnectorArgumentsException icae) { icae.printStackTrace(); MessageOutput.fatalError("Internal debugger error."); + throw new RuntimeException(icae); } catch (VMStartException vmse) { MessageOutput.println("vmstartexception", vmse.getMessage()); MessageOutput.println(); dumpFailedLaunchInfo(vmse.process()); MessageOutput.fatalError("Target VM failed to initialize."); + throw new RuntimeException(vmse); } - return null; // Shuts up the compiler } /* attach to running target vm */ @@ -564,11 +566,12 @@ class VMConnection { } catch (IOException ioe) { ioe.printStackTrace(); MessageOutput.fatalError("Unable to attach to target VM."); + throw new RuntimeException(ioe); } catch (IllegalConnectorArgumentsException icae) { icae.printStackTrace(); MessageOutput.fatalError("Internal debugger error."); + throw new RuntimeException(icae); } - return null; // Shuts up the compiler } /* listen for connection from target vm */ @@ -583,10 +586,11 @@ class VMConnection { } catch (IOException ioe) { ioe.printStackTrace(); MessageOutput.fatalError("Unable to attach to target VM."); + throw new RuntimeException(ioe); } catch (IllegalConnectorArgumentsException icae) { icae.printStackTrace(); MessageOutput.fatalError("Internal debugger error."); + throw new RuntimeException(icae); } - return null; // Shuts up the compiler } } diff --git a/test/jdk/com/sun/jdi/VMConnection.java b/test/jdk/com/sun/jdi/VMConnection.java index 18bd3d8956a..1444393e46b 100644 --- a/test/jdk/com/sun/jdi/VMConnection.java +++ b/test/jdk/com/sun/jdi/VMConnection.java @@ -322,15 +322,17 @@ class VMConnection { } catch (IOException ioe) { ioe.printStackTrace(); System.err.println("\n Unable to launch target VM."); + throw new RuntimeException(ioe); } catch (IllegalConnectorArgumentsException icae) { icae.printStackTrace(); System.err.println("\n Internal debugger error."); + throw new RuntimeException(icae); } catch (VMStartException vmse) { System.err.println(vmse.getMessage() + "\n"); dumpFailedLaunchInfo(vmse.process()); System.err.println("\n Target VM failed to initialize."); + throw new RuntimeException(vmse); } - return null; // Shuts up the compiler } /* attach to running target vm */ @@ -341,11 +343,12 @@ class VMConnection { } catch (IOException ioe) { ioe.printStackTrace(); System.err.println("\n Unable to attach to target VM."); + throw new RuntimeException(ioe); } catch (IllegalConnectorArgumentsException icae) { icae.printStackTrace(); System.err.println("\n Internal debugger error."); + throw new RuntimeException(icae); } - return null; // Shuts up the compiler } /* listen for connection from target vm */ @@ -360,10 +363,11 @@ class VMConnection { } catch (IOException ioe) { ioe.printStackTrace(); System.err.println("\n Unable to attach to target VM."); + throw new RuntimeException(ioe); } catch (IllegalConnectorArgumentsException icae) { icae.printStackTrace(); System.err.println("\n Internal debugger error."); + throw new RuntimeException(icae); } - return null; // Shuts up the compiler } }