mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8263894: Convert defaultPrinter and printers fields to local variables
Reviewed-by: prr, azvegint, kizune
This commit is contained in:
parent
ba504fcee8
commit
840ab7bf0f
1 changed files with 2 additions and 4 deletions
|
@ -43,9 +43,7 @@ import javax.print.attribute.standard.PrinterName;
|
|||
|
||||
public class PrintServiceLookupProvider extends PrintServiceLookup {
|
||||
|
||||
private String defaultPrinter;
|
||||
private PrintService defaultPrintService;
|
||||
private String[] printers; /* excludes the default printer */
|
||||
private PrintService[] printServices; /* includes the default printer */
|
||||
|
||||
static {
|
||||
|
@ -114,7 +112,7 @@ public class PrintServiceLookupProvider extends PrintServiceLookup {
|
|||
}
|
||||
|
||||
private synchronized void refreshServices() {
|
||||
printers = getAllPrinterNames();
|
||||
String[] printers = getAllPrinterNames();
|
||||
if (printers == null) {
|
||||
// In Windows it is safe to assume no default if printers == null so we
|
||||
// don't get the default.
|
||||
|
@ -279,7 +277,7 @@ public class PrintServiceLookupProvider extends PrintServiceLookup {
|
|||
|
||||
// Windows does not have notification for a change in default
|
||||
// so we always get the latest.
|
||||
defaultPrinter = getDefaultPrinterName();
|
||||
String defaultPrinter = getDefaultPrinterName();
|
||||
if (defaultPrinter == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue