Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8263894: Convert defaultPrinter and printers fields to local variables #3095

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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 PrintServiceLookupProvider() {
}

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