Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8268675

RTE from "Printable.print" propagates through "PrinterJob.print"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 8, 11, 16, 17, 18
    • client-libs
    • 2d
    • linux, windows

      FULL PRODUCT VERSION :
      JDK 17+19, JDK 8u291 b10, JDK 8 b132

      ADDITIONAL OS VERSION INFORMATION :
      MS Windows 10 OS, Cent OS Linux 8 OS

      A DESCRIPTION OF THE PROBLEM :
      If during the call "java.awt.print.PrinterJob.print()" the method "java.awt.print.Printable.print​(Graphics, PageFormat, int)" throws "java.lang.RuntimeException", then this "RuntimeException" is propagated as is through "PrinterJob.print()" method. By Java SE Specification "PrinterJob.print()" can throw only "java.awt.print.PrinterException", therefore such "RuntimeException" should be a cause of a properly handled "PrinterException".

      The bug was discovered during the review of the fix for the bug JDK-8262731, where it was decided that the described behavior of JDK is incorrect. The bug does not affect JDK for macOS, because part of the fix JDK-8262731 addresses it.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Compile and run the test case "ExceptionFromPrintableIsIgnored.java" attached to the bug JDK-8262731.
      2. In the shown window of the test case select "java.lang.RuntimeException" radio button and select on which thread the method "java.awt.print.PrinterJob.print" should be executed.
      3. Click "Run Test" button.

      The bug is reproduced, if "RuntimeException" rather than "PrinterException" is displayed in the text area "Test Results:".

            rkannathpari Renjith Kannath Pariyangad
            alitvinov Anton Litvinov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: