Skip to content

Commit 636ceee

Browse files
committed
8352509: Update jdk.test.lib.SecurityTools jar method to accept List<String> parameter
Backport-of: fa0b18bfde38ee2ffbab33a9eaac547fe8aa3c7c
1 parent be9fc0b commit 636ceee

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

test/lib/jdk/test/lib/SecurityTools.java

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -233,6 +233,17 @@ public static OutputAnalyzer kinit(String args) throws Exception {
233233
return execute(getProcessBuilder("kinit", makeList(args)));
234234
}
235235

236+
/**
237+
* Runs jar.
238+
*
239+
* @param args arguments to jar in the list.
240+
* @return an {@link OutputAnalyzer} object
241+
* @throws Exception if there is an error
242+
*/
243+
public static OutputAnalyzer jar(final List<String> args) throws Exception {
244+
return execute(getProcessBuilder("jar", args));
245+
}
246+
236247
/**
237248
* Runs jar.
238249
*
@@ -241,8 +252,20 @@ public static OutputAnalyzer kinit(String args) throws Exception {
241252
* @return an {@link OutputAnalyzer} object
242253
* @throws Exception if there is an error
243254
*/
244-
public static OutputAnalyzer jar(String args) throws Exception {
245-
return execute(getProcessBuilder("jar", makeList(args)));
255+
public static OutputAnalyzer jar(final String args) throws Exception {
256+
return jar(makeList(args));
257+
}
258+
259+
/**
260+
* Runs jar.
261+
*
262+
* @param args arguments to jar in multiple strings.
263+
* Converted to be a List with List.of.
264+
* @return an {@link OutputAnalyzer} object
265+
* @throws Exception if there is an error
266+
*/
267+
public static OutputAnalyzer jar(final String... args) throws Exception {
268+
return jar(List.of(args));
246269
}
247270

248271
/**

0 commit comments

Comments
 (0)