< prev index next >
src/java.desktop/share/classes/java/awt/print/PrinterJob.java
Print this page
@@ -77,17 +77,16 @@
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<PrinterJob>() {
public PrinterJob run() {
String nm = System.getProperty("java.awt.printerjob", null);
try {
- return (PrinterJob)Class.forName(nm).newInstance();
+ return (PrinterJob)Class.forName(nm).
+ getConstructor().newInstance();
} catch (ClassNotFoundException e) {
throw new AWTError("PrinterJob not found: " + nm);
- } catch (InstantiationException e) {
+ } catch (ReflectiveOperationException e) {
throw new AWTError("Could not instantiate PrinterJob: " + nm);
- } catch (IllegalAccessException e) {
- throw new AWTError("Could not access PrinterJob: " + nm);
}
}
});
}
< prev index next >