Check for a behavior change on Toolkit getPrintJob method

This rule flags instances of the java.awt.Toolkit getPrintJob() method because it now throws a NullPointerException instead of a HeadlessException.

According to Java SE 7 and JDK 7 Compatibility documentation, in headless environments the getPrintJob method previously threw a HeadlessException. The method now correctly throws a NullPointerException. This rule flags java.awt.Toolkit getPrintJob() method invocations that are surrounded by a try block that catches HeadlessException.

Evaluate the flagged code and determine if it is affected by the behavior change, pursue any appropriate testing, and make any necessary changes to the code.

For additional information, see the Java 7 API: