src/solaris/classes/sun/print/UnixPrintJob.java
Print this page
*** 88,100 ****
public class UnixPrintJob implements CancelablePrintJob {
private static String debugPrefix = "UnixPrintJob>> ";
! transient private Vector jobListeners;
! transient private Vector attrListeners;
! transient private Vector listenedAttributeSets;
private PrintService service;
private boolean fidelity;
private boolean printing = false;
private boolean printReturned = false;
--- 88,100 ----
public class UnixPrintJob implements CancelablePrintJob {
private static String debugPrefix = "UnixPrintJob>> ";
! transient private Vector<PrintJobListener> jobListeners;
! transient private Vector<PrintJobAttributeListener> attrListeners;
! transient private Vector<PrintJobAttributeSet> listenedAttributeSets;
private PrintService service;
private boolean fidelity;
private boolean printing = false;
private boolean printReturned = false;
*** 148,158 ****
synchronized (this) {
if (listener == null) {
return;
}
if (jobListeners == null) {
! jobListeners = new Vector();
}
jobListeners.add(listener);
}
}
--- 148,158 ----
synchronized (this) {
if (listener == null) {
return;
}
if (jobListeners == null) {
! jobListeners = new Vector<>();
}
jobListeners.add(listener);
}
}
*** 236,246 ****
synchronized (this) {
if (jobListeners != null) {
PrintJobListener listener;
PrintJobEvent event = new PrintJobEvent(this, reason);
for (int i = 0; i < jobListeners.size(); i++) {
! listener = (PrintJobListener)(jobListeners.elementAt(i));
switch (reason) {
case PrintJobEvent.JOB_CANCELED :
listener.printJobCanceled(event);
break;
--- 236,246 ----
synchronized (this) {
if (jobListeners != null) {
PrintJobListener listener;
PrintJobEvent event = new PrintJobEvent(this, reason);
for (int i = 0; i < jobListeners.size(); i++) {
! listener = jobListeners.elementAt(i);
switch (reason) {
case PrintJobEvent.JOB_CANCELED :
listener.printJobCanceled(event);
break;
*** 271,282 ****
synchronized (this) {
if (listener == null) {
return;
}
if (attrListeners == null) {
! attrListeners = new Vector();
! listenedAttributeSets = new Vector();
}
attrListeners.add(listener);
if (attributes == null) {
attributes = new HashPrintJobAttributeSet();
}
--- 271,282 ----
synchronized (this) {
if (listener == null) {
return;
}
if (attrListeners == null) {
! attrListeners = new Vector<>();
! listenedAttributeSets = new Vector<>();
}
attrListeners.add(listener);
if (attributes == null) {
attributes = new HashPrintJobAttributeSet();
}
*** 768,778 ****
jobAttrSet = AttributeSetUtilities.unmodifiableView(jobAttrSet);
}
private void getAttributeValues(DocFlavor flavor) throws PrintException {
Attribute attr;
! Class category;
if (reqAttrSet.get(Fidelity.class) == Fidelity.FIDELITY_TRUE) {
fidelity = true;
} else {
fidelity = false;
--- 768,778 ----
jobAttrSet = AttributeSetUtilities.unmodifiableView(jobAttrSet);
}
private void getAttributeValues(DocFlavor flavor) throws PrintException {
Attribute attr;
! Class<? extends Attribute> category;
if (reqAttrSet.get(Fidelity.class) == Fidelity.FIDELITY_TRUE) {
fidelity = true;
} else {
fidelity = false;
*** 939,953 ****
private String mDestination, mOptions="";
private boolean mNoJobSheet = false;
// Inner class to run "privileged" to open the printer output stream.
! private class PrinterOpener implements java.security.PrivilegedAction {
PrintException pex;
OutputStream result;
! public Object run() {
try {
if (mDestType == UnixPrintJob.DESTFILE) {
spoolFile = new File(mDestination);
} else {
/* Write to a temporary file which will be spooled to
--- 939,953 ----
private String mDestination, mOptions="";
private boolean mNoJobSheet = false;
// Inner class to run "privileged" to open the printer output stream.
! private class PrinterOpener implements java.security.PrivilegedAction<OutputStream> {
PrintException pex;
OutputStream result;
! public OutputStream run() {
try {
if (mDestType == UnixPrintJob.DESTFILE) {
spoolFile = new File(mDestination);
} else {
/* Write to a temporary file which will be spooled to
*** 969,979 ****
}
}
// Inner class to run "privileged" to invoke the system print command
! private class PrinterSpooler implements java.security.PrivilegedAction {
PrintException pex;
private void handleProcessFailure(final Process failedProcess,
final String[] execCmd, final int result) throws IOException {
try (StringWriter sw = new StringWriter();
--- 969,979 ----
}
}
// Inner class to run "privileged" to invoke the system print command
! private class PrinterSpooler implements java.security.PrivilegedAction<Object> {
PrintException pex;
private void handleProcessFailure(final Process failedProcess,
final String[] execCmd, final int result) throws IOException {
try (StringWriter sw = new StringWriter();