> 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).

Alexander Zvegintsev has updated the pull request incrementally with one 
additional commit since the last revision:

  Error -> RuntimeException

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/32168/files
  - new: https://git.openjdk.org/jdk/pull/32168/files/73fda1dc..a0118f2d

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=32168&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=32168&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/32168.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32168/head:pull/32168

PR: https://git.openjdk.org/jdk/pull/32168

Reply via email to