RFR: 8268675: RTE from "Printable.print" propagates through "PrinterJob.print" [v3]

Prasanta Sadhukhan psadhukhan at openjdk.org
Wed Feb 25 11:08:37 UTC 2026


On Tue, 24 Feb 2026 10:28:55 GMT, Renjith Kannath Pariyangad <rkannathpari at openjdk.org> wrote:

>> test/jdk/java/awt/print/PrinterJob/ExceptionFromPrintableIsIgnoredTest.java line 66:
>> 
>>> 64:                 "Test started. threadType='%s', exceptionType='%s'",
>>> 65:                 threadType, exceptionType));
>>> 66: 
>> 
>> I believe this test is passing without the fix...It would be better to have a test where you can throw a RTE forcefully and which would fail if it gets an exception other than PrinterException
>
> With out fix test throwing **Unexpected exception was thrown** for argument `MAIN RE`, please find the message. **MAIN/EDT RE** was skipped earlier for Windows and Linux. 
> 
> 
> java.lang.RuntimeException: Exception from 'Printable.print'.
>         at ExceptionFromPrintableIsIgnoredTest$2.print(ExceptionFromPrintableIsIgnoredTest.java:110)
>         at java.desktop/sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:2214)
>         at java.desktop/sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1603)
>         at java.desktop/sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1433)
>         at ExceptionFromPrintableIsIgnoredTest.runTest(ExceptionFromPrintableIsIgnoredTest.java:118)
>         at ExceptionFromPrintableIsIgnoredTest.<init>(ExceptionFromPrintableIsIgnoredTest.java:70)
>         at ExceptionFromPrintableIsIgnoredTest.main(ExceptionFromPrintableIsIgnoredTest.java:57)
>         at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:565)
>         at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.execute(SourceLauncher.java:260)
>         at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.run(SourceLauncher.java:138)
>         at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.main(SourceLauncher.java:76)
> Exception in thread "main" java.lang.RuntimeException: Unexpected exception was thrown.
>         at ExceptionFromPrintableIsIgnoredTest.<init>(ExceptionFromPrintableIsIgnoredTest.java:87)
>         at ExceptionFromPrintableIsIgnoredTest.main(ExceptionFromPrintableIsIgnoredTest.java:57)

Yes, I see..

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29733#discussion_r2850743087


More information about the client-libs-dev mailing list