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

Remove the terminally deprecated finalize() method from the java.awt.PrintJob class

    XMLWordPrintable

    Details

    • Subcomponent:
      2d

      Description


      The java.awt.PrintJob class defines

          public void finalize() {
              end();
          }

       
      which https://bugs.openjdk.java.net/browse/JDK-8276748 deprecates for removal.

      Calling end() is important to terminate printing and make sure the job is spooled to the printer.
      An application should do this directly, as in a try-with-resources model.
      Any applications relying on finalize() probably would see large and unpredictable delays in the job actually printing,
      but since some applications may have been ill-advisedly or accidentally relying on the finalize() method
      we should look into whether java.lang.ref.Cleaner or the 2D Disposer should be used at an implementation
      level to replace this clean up.

        Attachments

          Activity

            People

            Assignee:
            prr Philip Race
            Reporter:
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: