Skip to content

Commit ab9ef59

Browse files
committed
8355441: Remove antipattern from PassFailJFrame.forcePass javadoc
Backport-of: bd7561c315e8fd80e32cb154998bd28745c98682
1 parent bf24a1e commit ab9ef59

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

test/jdk/java/awt/regtesthelpers/PassFailJFrame.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,14 +1294,16 @@ private static synchronized void showUI() {
12941294

12951295
/**
12961296
* Forcibly pass the test.
1297-
* <p>The sample usage:
1298-
* <pre><code>
1299-
* PrinterJob pj = PrinterJob.getPrinterJob();
1300-
* if (pj == null || pj.getPrintService() == null) {
1301-
* System.out.println(""Printer not configured or available.");
1302-
* PassFailJFrame.forcePass();
1303-
* }
1304-
* </code></pre>
1297+
* <p>
1298+
* Use this method in semi-automatic tests when
1299+
* the test determines that all the conditions for passing the test are met.
1300+
* <p>
1301+
* <strong>Do not use</strong> this method in cases where a resource is unavailable or a
1302+
* feature isn't supported, throw {@code jtreg.SkippedException} instead.
1303+
*
1304+
* <p>A sample usage can be found in
1305+
* <a href="https://github.com/openjdk/jdk/blob/7283c8b/test/jdk/java/awt/FileDialog/SaveFileNameOverrideTest.java#L84">{@code
1306+
* SaveFileNameOverrideTest.java}</a>
13051307
*/
13061308
public static void forcePass() {
13071309
latch.countDown();

0 commit comments

Comments
 (0)