8298447: Unnecessary Vector usage in DocPrintJob implementations

Reviewed-by: serb
This commit is contained in:
Andrey Turbanov 2023-01-06 08:29:47 +00:00
parent cc4936a79e
commit 0234f813e6
3 changed files with 24 additions and 24 deletions

View File

@ -29,7 +29,7 @@ import java.net.URL;
import java.io.InputStream;
import java.io.IOException;
import java.io.Reader;
import java.util.Vector;
import java.util.ArrayList;
import javax.print.CancelablePrintJob;
import javax.print.Doc;
@ -64,9 +64,9 @@ import java.awt.print.*;
public class PSStreamPrintJob implements CancelablePrintJob {
private transient Vector<PrintJobListener> jobListeners;
private transient Vector<PrintJobAttributeListener> attrListeners;
private transient Vector<PrintJobAttributeSet> listenedAttributeSets;
private transient ArrayList<PrintJobListener> jobListeners;
private transient ArrayList<PrintJobAttributeListener> attrListeners;
private transient ArrayList<PrintJobAttributeSet> listenedAttributeSets;
private PSStreamPrintService service;
private boolean fidelity;
@ -115,7 +115,7 @@ public class PSStreamPrintJob implements CancelablePrintJob {
return;
}
if (jobListeners == null) {
jobListeners = new Vector<>();
jobListeners = new ArrayList<>();
}
jobListeners.add(listener);
}
@ -189,7 +189,7 @@ public class PSStreamPrintJob implements CancelablePrintJob {
PrintJobListener listener;
PrintJobEvent event = new PrintJobEvent(this, reason);
for (int i = 0; i < jobListeners.size(); i++) {
listener = jobListeners.elementAt(i);
listener = jobListeners.get(i);
switch (reason) {
case PrintJobEvent.JOB_CANCELED :
@ -228,8 +228,8 @@ public class PSStreamPrintJob implements CancelablePrintJob {
return;
}
if (attrListeners == null) {
attrListeners = new Vector<>();
listenedAttributeSets = new Vector<>();
attrListeners = new ArrayList<>();
listenedAttributeSets = new ArrayList<>();
}
attrListeners.add(listener);
if (attributes == null) {

View File

@ -42,7 +42,7 @@ import java.io.PrintWriter;
import java.io.Reader;
import java.io.StringWriter;
import java.nio.file.Files;
import java.util.Vector;
import java.util.ArrayList;
import javax.print.CancelablePrintJob;
import javax.print.Doc;
@ -90,9 +90,9 @@ import java.awt.print.PrinterException;
public class UnixPrintJob implements CancelablePrintJob {
private static String debugPrefix = "UnixPrintJob>> ";
private transient Vector<PrintJobListener> jobListeners;
private transient Vector<PrintJobAttributeListener> attrListeners;
private transient Vector<PrintJobAttributeSet> listenedAttributeSets;
private transient ArrayList<PrintJobListener> jobListeners;
private transient ArrayList<PrintJobAttributeListener> attrListeners;
private transient ArrayList<PrintJobAttributeSet> listenedAttributeSets;
private PrintService service;
private boolean fidelity;
@ -155,7 +155,7 @@ public class UnixPrintJob implements CancelablePrintJob {
return;
}
if (jobListeners == null) {
jobListeners = new Vector<>();
jobListeners = new ArrayList<>();
}
jobListeners.add(listener);
}
@ -243,7 +243,7 @@ public class UnixPrintJob implements CancelablePrintJob {
PrintJobListener listener;
PrintJobEvent event = new PrintJobEvent(this, reason);
for (int i = 0; i < jobListeners.size(); i++) {
listener = jobListeners.elementAt(i);
listener = jobListeners.get(i);
switch (reason) {
case PrintJobEvent.JOB_CANCELED :
@ -278,8 +278,8 @@ public class UnixPrintJob implements CancelablePrintJob {
return;
}
if (attrListeners == null) {
attrListeners = new Vector<>();
listenedAttributeSets = new Vector<>();
attrListeners = new ArrayList<>();
listenedAttributeSets = new ArrayList<>();
}
attrListeners.add(listener);
if (attributes == null) {

View File

@ -35,7 +35,7 @@ import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.Vector;
import java.util.ArrayList;
import javax.print.CancelablePrintJob;
import javax.print.Doc;
@ -75,9 +75,9 @@ import java.awt.print.*;
public class Win32PrintJob implements CancelablePrintJob {
private transient Vector<PrintJobListener> jobListeners;
private transient Vector<PrintJobAttributeListener> attrListeners;
private transient Vector<PrintJobAttributeSet> listenedAttributeSets;
private transient ArrayList<PrintJobListener> jobListeners;
private transient ArrayList<PrintJobAttributeListener> attrListeners;
private transient ArrayList<PrintJobAttributeSet> listenedAttributeSets;
private Win32PrintService service;
private boolean fidelity;
@ -135,7 +135,7 @@ public class Win32PrintJob implements CancelablePrintJob {
return;
}
if (jobListeners == null) {
jobListeners = new Vector<>();
jobListeners = new ArrayList<>();
}
jobListeners.add(listener);
}
@ -223,7 +223,7 @@ public class Win32PrintJob implements CancelablePrintJob {
PrintJobListener listener;
PrintJobEvent event = new PrintJobEvent(this, reason);
for (int i = 0; i < jobListeners.size(); i++) {
listener = jobListeners.elementAt(i);
listener = jobListeners.get(i);
switch (reason) {
case PrintJobEvent.JOB_COMPLETE :
@ -262,8 +262,8 @@ public class Win32PrintJob implements CancelablePrintJob {
return;
}
if (attrListeners == null) {
attrListeners = new Vector<>();
listenedAttributeSets = new Vector<>();
attrListeners = new ArrayList<>();
listenedAttributeSets = new ArrayList<>();
}
attrListeners.add(listener);
if (attributes == null) {