diff --git a/test/lib/jdk/test/lib/process/ProcessTools.java b/test/lib/jdk/test/lib/process/ProcessTools.java index 8a8e8043646..9e3da659078 100644 --- a/test/lib/jdk/test/lib/process/ProcessTools.java +++ b/test/lib/jdk/test/lib/process/ProcessTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -453,7 +453,7 @@ public static OutputAnalyzer executeProcess(ProcessBuilder pb, String input) thr * @param cmds The command line to execute. * @return The output from the process. */ - public static OutputAnalyzer executeProcess(String... cmds) throws Throwable { + public static OutputAnalyzer executeProcess(String... cmds) throws Exception { return executeProcess(new ProcessBuilder(cmds)); } @@ -498,8 +498,7 @@ public static String getCommandLine(ProcessBuilder pb) { * @param cmds The command line to execute. * @return The {@linkplain OutputAnalyzer} instance wrapping the process. */ - public static OutputAnalyzer executeCommand(String... cmds) - throws Throwable { + public static OutputAnalyzer executeCommand(String... cmds) throws Exception { String cmdLine = String.join(" ", cmds); System.out.println("Command line: [" + cmdLine + "]"); OutputAnalyzer analyzer = ProcessTools.executeProcess(cmds); @@ -516,8 +515,7 @@ public static OutputAnalyzer executeCommand(String... cmds) * @param pb The ProcessBuilder to execute. * @return The {@linkplain OutputAnalyzer} instance wrapping the process. */ - public static OutputAnalyzer executeCommand(ProcessBuilder pb) - throws Throwable { + public static OutputAnalyzer executeCommand(ProcessBuilder pb) throws Exception { String cmdLine = pb.command().stream() .map(x -> (x.contains(" ") || x.contains("$")) ? ("'" + x + "'") : x)