Skip to content
Permalink
Browse files
8263894: Convert defaultPrinter and printers fields to local variables
Reviewed-by: prr, azvegint, kizune
  • Loading branch information
aivanov-jdk committed Mar 22, 2021
1 parent ba504fc commit 840ab7bf0fbadb3c99b170247f6414a6a8808370
Showing 1 changed file with 2 additions and 4 deletions.
@@ -43,9 +43,7 @@

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 synchronized PrintService[] getPrintServices() {
}

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 synchronized PrintService getDefaultPrintService() {

// 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;
}

0 comments on commit 840ab7b

Please sign in to comment.