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

[macosx] getPrintJob doesn't throw NPE if Frame is null AND type is COMMON.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: client-libs
    • Environment:

      OS X 10.11 (and perhaps any earlier).

    • Subcomponent:
    • Resolved In Build:
      b117

      Description

      Run the following test on OS X:

      import java.awt.*;

      public class TT {
          public static void main(String args[]) {
              JobAttributes ja = new JobAttributes();
              ja.setDialog(JobAttributes.DialogType.COMMON);
              Toolkit.getDefaultToolkit().getPrintJob(null, "Test Printing", ja, null);
          }
      }

      It should throw NPE but it doesn't. On a machine with a printer configured it just does show a print dialog.

      I tried OS X 10.11 and jdk9 b113 but I guess any Oracle JDK would behave like this on any supported OS X version.

        Attachments

          Activity

            People

            Assignee:
            psadhukhan Prasanta Sadhukhan
            Reporter:
            yan Yuri Nesterenko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: