8021583: test/javax/print/autosense/PrintAutoSenseData.java throwing NPE

Reviewed-by: jchen, prr
This commit is contained in:
Jennifer Godinez 2013-08-06 14:22:48 -07:00
parent 2ce2cb1e0d
commit d75477b147
4 changed files with 10 additions and 1 deletions

View File

@ -334,6 +334,10 @@ public class UnixPrintJob implements CancelablePrintJob {
throw new PrintException("can't get print data: " + e.toString());
}
if (data == null) {
throw new PrintException("Null print data.");
}
if (flavor == null || (!service.isDocFlavorSupported(flavor))) {
notifyEvent(PrintJobEvent.JOB_FAILED);
throw new PrintJobFlavorException("invalid flavor", flavor);

View File

@ -340,6 +340,10 @@ public class Win32PrintJob implements CancelablePrintJob {
throw new PrintException("can't get print data: " + e.toString());
}
if (data == null) {
throw new PrintException("Null print data.");
}
if (flavor == null || (!service.isDocFlavorSupported(flavor))) {
notifyEvent(PrintJobEvent.JOB_FAILED);
throw new PrintJobFlavorException("invalid flavor", flavor);

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4468109
* @bug 4468109 8021583
* @summary Test for printing AUTOSENSE DocFlavor. No exception should be thrown.
* @run main PrintAutoSenseData
*/

View File

@ -0,0 +1 @@
This is a program for testing AutoSense data.