Skip to content

Commit 7e80c98

Browse files
committed
8254261: fix javadocs in jdk.test.lib.Utils
Reviewed-by: shade
1 parent d4b5dfd commit 7e80c98

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

test/lib/jdk/test/lib/Utils.java

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,15 @@ public static String[] addTestJavaOpts(String... userArgs) {
246246
return prependTestJavaOpts(userArgs);
247247
}
248248

249+
private static final Pattern useGcPattern = Pattern.compile(
250+
"(?:\\-XX\\:[\\+\\-]Use.+GC)");
249251
/**
250252
* Removes any options specifying which GC to use, for example "-XX:+UseG1GC".
251253
* Removes any options matching: -XX:(+/-)Use*GC
252254
* Used when a test need to set its own GC version. Then any
253255
* GC specified by the framework must first be removed.
254256
* @return A copy of given opts with all GC options removed.
255257
*/
256-
private static final Pattern useGcPattern = Pattern.compile(
257-
"(?:\\-XX\\:[\\+\\-]Use.+GC)");
258258
public static List<String> removeGcOpts(List<String> opts) {
259259
List<String> optsWithoutGC = new ArrayList<String>();
260260
for (String opt : opts) {
@@ -564,7 +564,7 @@ public static <T> T getRandomElement(T[] array)
564564
/**
565565
* Wait for condition to be true
566566
*
567-
* @param condition, a condition to wait for
567+
* @param condition a condition to wait for
568568
*/
569569
public static final void waitForCondition(BooleanSupplier condition) {
570570
waitForCondition(condition, -1L, 100L);
@@ -573,7 +573,7 @@ public static final void waitForCondition(BooleanSupplier condition) {
573573
/**
574574
* Wait until timeout for condition to be true
575575
*
576-
* @param condition, a condition to wait for
576+
* @param condition a condition to wait for
577577
* @param timeout a time in milliseconds to wait for condition to be true
578578
* specifying -1 will wait forever
579579
* @return condition value, to determine if wait was successful
@@ -586,7 +586,7 @@ public static final boolean waitForCondition(BooleanSupplier condition,
586586
/**
587587
* Wait until timeout for condition to be true for specified time
588588
*
589-
* @param condition, a condition to wait for
589+
* @param condition a condition to wait for
590590
* @param timeout a time in milliseconds to wait for condition to be true,
591591
* specifying -1 will wait forever
592592
* @param sleepTime a time to sleep value in milliseconds
@@ -619,13 +619,13 @@ public static interface ThrowingRunnable {
619619
* Filters out an exception that may be thrown by the given
620620
* test according to the given filter.
621621
*
622-
* @param test - method that is invoked and checked for exception.
623-
* @param filter - function that checks if the thrown exception matches
624-
* criteria given in the filter's implementation.
625-
* @return - exception that matches the filter if it has been thrown or
626-
* {@code null} otherwise.
627-
* @throws Throwable - if test has thrown an exception that does not
628-
* match the filter.
622+
* @param test method that is invoked and checked for exception.
623+
* @param filter function that checks if the thrown exception matches
624+
* criteria given in the filter's implementation.
625+
* @return exception that matches the filter if it has been thrown or
626+
* {@code null} otherwise.
627+
* @throws Throwable if test has thrown an exception that does not
628+
* match the filter.
629629
*/
630630
public static Throwable filterException(ThrowingRunnable test,
631631
Function<Throwable, Boolean> filter) throws Throwable {
@@ -786,19 +786,21 @@ public static OutputAnalyzer uname(String... args) throws Throwable {
786786
/**
787787
* Creates an empty file in "user.dir" if the property set.
788788
* <p>
789-
* This method is meant as a replacement for {@code Files#createTempFile(String, String, FileAttribute...)}
789+
* This method is meant as a replacement for {@link Files#createTempFile(String, String, FileAttribute...)}
790790
* that doesn't leave files behind in /tmp directory of the test machine
791791
* <p>
792792
* If the property "user.dir" is not set, "." will be used.
793793
*
794-
* @param prefix
795-
* @param suffix
796-
* @param attrs
794+
* @param prefix the prefix string to be used in generating the file's name;
795+
* may be null
796+
* @param suffix the suffix string to be used in generating the file's name;
797+
* may be null, in which case ".tmp" is used
798+
* @param attrs an optional list of file attributes to set atomically when creating the file
797799
* @return the path to the newly created file that did not exist before this
798800
* method was invoked
799-
* @throws IOException
801+
* @throws IOException if an I/O error occurs or dir does not exist
800802
*
801-
* @see {@link Files#createTempFile(String, String, FileAttribute...)}
803+
* @see Files#createTempFile(String, String, FileAttribute...)
802804
*/
803805
public static Path createTempFile(String prefix, String suffix, FileAttribute<?>... attrs) throws IOException {
804806
Path dir = Paths.get(System.getProperty("user.dir", "."));
@@ -808,17 +810,17 @@ public static Path createTempFile(String prefix, String suffix, FileAttribute<?>
808810
/**
809811
* Creates an empty directory in "user.dir" or "."
810812
* <p>
811-
* This method is meant as a replacement for {@code Files#createTempDirectory(String, String, FileAttribute...)}
813+
* This method is meant as a replacement for {@link Files#createTempDirectory(Path, String, FileAttribute...)}
812814
* that doesn't leave files behind in /tmp directory of the test machine
813815
* <p>
814816
* If the property "user.dir" is not set, "." will be used.
815817
*
816-
* @param prefix
817-
* @param attrs
818+
* @param prefix the prefix string to be used in generating the directory's name; may be null
819+
* @param attrs an optional list of file attributes to set atomically when creating the directory
818820
* @return the path to the newly created directory
819-
* @throws IOException
821+
* @throws IOException if an I/O error occurs or dir does not exist
820822
*
821-
* @see {@link Files#createTempDirectory(String, String, FileAttribute...)}
823+
* @see Files#createTempDirectory(Path, String, FileAttribute...)
822824
*/
823825
public static Path createTempDirectory(String prefix, FileAttribute<?>... attrs) throws IOException {
824826
Path dir = Paths.get(System.getProperty("user.dir", "."));

0 commit comments

Comments
 (0)