On Sun, 30 May 2021 18:08:38 GMT, Phil Race <p...@openjdk.org> wrote:

>> Anton Litvinov has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Second version of the fix
>
> test/jdk/java/awt/print/PrinterJob/ExceptionFromPrintableIsIgnoredTest.java 
> line 85:
> 
>> 83:         PrinterJob job = PrinterJob.getPrinterJob();
>> 84:         if (job.getPrintService() == null) {
>> 85:             throw new RuntimeException("No printers are available.");
> 
> where does this exception go if it happens and you are on EDT ?

If this exception happens on EDT, this exception as any other exception thrown 
from the method "runTest" will be perfectly caught and handled in "catch" block 
of the constructor of the test "ExceptionFromPrintableIsIgnoredTest" as 
"InvocationTargetException" instance, which will have this "RuntimeException" 
as its cause. The whole test relies on this approach of throwing and catching 
the exception and it works.

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

PR: https://git.openjdk.java.net/jdk/pull/4036

Reply via email to