On Mon, 3 Aug 2026 05:03:11 GMT, Alexander Zvegintsev <[email protected]> 
wrote:

> While working on [JDK-8379673](https://bugs.openjdk.org/browse/JDK-8379673), 
> I noticed that an `Error` thrown by the test is being swallowed in a `catch` 
> block:
> 
> 
> try {
>     EventQueue.invokeAndWait(new Runnable() {
>         public void run() {
>             repaint();
>             checkFSDisplay(fs); // throws Error on failure
>         }
>     });
> } catch (InvocationTargetException | InterruptedException ex) {
>     ex.printStackTrace();
> }
> 
> 
> There are a few other issues with the test:
> 
> * Robot creation failure is ignored.
> * The screenshot is taken immediately after `repaint()`. As a result, the 
> test may capture the frame before rendering has actually completed.
> * A separate thread is not really necessary.
> * `-Dsun.java2d.d3d=false` test run is only applicable for Windows.
> 
> 
> ---
> The changeset fixes the issues described above, simplifies the test, and 
> limits the `-Dsun.java2d.d3d=false` test run to Windows only.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Marked as reviewed by psadhukhan (Reviewer).

test/jdk/java/awt/FullScreen/SetFSWindow/FSFrame.java line 122:

> 120:             } catch (IOException ignored) {}
> 121: 
> 122:             throw new Error("Some pixel colors not correct; FS window 
> may not" +

maybe you can replace Error with RuntimeException

-------------

PR Review: https://git.openjdk.org/jdk/pull/32168#pullrequestreview-4842703995
PR Review Comment: https://git.openjdk.org/jdk/pull/32168#discussion_r3702813915

Reply via email to