src/solaris/classes/sun/print/UnixPrintJob.java
Print this page
@@ -88,13 +88,13 @@
public class UnixPrintJob implements CancelablePrintJob {
private static String debugPrefix = "UnixPrintJob>> ";
- transient private Vector jobListeners;
- transient private Vector attrListeners;
- transient private Vector listenedAttributeSets;
+ 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,11 +148,11 @@
synchronized (this) {
if (listener == null) {
return;
}
if (jobListeners == null) {
- jobListeners = new Vector();
+ jobListeners = new Vector<>();
}
jobListeners.add(listener);
}
}
@@ -236,11 +236,11 @@
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));
+ listener = jobListeners.elementAt(i);
switch (reason) {
case PrintJobEvent.JOB_CANCELED :
listener.printJobCanceled(event);
break;
@@ -271,12 +271,12 @@
synchronized (this) {
if (listener == null) {
return;
}
if (attrListeners == null) {
- attrListeners = new Vector();
- listenedAttributeSets = new Vector();
+ attrListeners = new Vector<>();
+ listenedAttributeSets = new Vector<>();
}
attrListeners.add(listener);
if (attributes == null) {
attributes = new HashPrintJobAttributeSet();
}
@@ -768,11 +768,11 @@
jobAttrSet = AttributeSetUtilities.unmodifiableView(jobAttrSet);
}
private void getAttributeValues(DocFlavor flavor) throws PrintException {
Attribute attr;
- Class category;
+ Class<? extends Attribute> category;
if (reqAttrSet.get(Fidelity.class) == Fidelity.FIDELITY_TRUE) {
fidelity = true;
} else {
fidelity = false;
@@ -939,15 +939,15 @@
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 {
+ private class PrinterOpener implements java.security.PrivilegedAction<OutputStream> {
PrintException pex;
OutputStream result;
- public Object run() {
+ public OutputStream run() {
try {
if (mDestType == UnixPrintJob.DESTFILE) {
spoolFile = new File(mDestination);
} else {
/* Write to a temporary file which will be spooled to
@@ -969,11 +969,11 @@
}
}
// Inner class to run "privileged" to invoke the system print command
- private class PrinterSpooler implements java.security.PrivilegedAction {
+ 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();