From fa0b18bfde38ee2ffbab33a9eaac547fe8aa3c7c Mon Sep 17 00:00:00 2001 From: Mikhail Yankelevich Date: Tue, 25 Mar 2025 13:04:30 +0000 Subject: [PATCH] 8352509: Update jdk.test.lib.SecurityTools jar method to accept List parameter Reviewed-by: weijun --- test/lib/jdk/test/lib/SecurityTools.java | 29 +++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/test/lib/jdk/test/lib/SecurityTools.java b/test/lib/jdk/test/lib/SecurityTools.java index ff13343ad32..2bc56ad4c43 100644 --- a/test/lib/jdk/test/lib/SecurityTools.java +++ b/test/lib/jdk/test/lib/SecurityTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2025, 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 @@ -233,6 +233,17 @@ public class SecurityTools { return execute(getProcessBuilder("kinit", makeList(args))); } + /** + * Runs jar. + * + * @param args arguments to jar in the list. + * @return an {@link OutputAnalyzer} object + * @throws Exception if there is an error + */ + public static OutputAnalyzer jar(final List args) throws Exception { + return execute(getProcessBuilder("jar", args)); + } + /** * Runs jar. * @@ -241,8 +252,20 @@ public class SecurityTools { * @return an {@link OutputAnalyzer} object * @throws Exception if there is an error */ - public static OutputAnalyzer jar(String args) throws Exception { - return execute(getProcessBuilder("jar", makeList(args))); + public static OutputAnalyzer jar(final String args) throws Exception { + return jar(makeList(args)); + } + + /** + * Runs jar. + * + * @param args arguments to jar in multiple strings. + * Converted to be a List with List.of. + * @return an {@link OutputAnalyzer} object + * @throws Exception if there is an error + */ + public static OutputAnalyzer jar(final String... args) throws Exception { + return jar(List.of(args)); } /**