< prev index next >

src/java.desktop/unix/classes/sun/print/UnixPrintService.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -287,11 +287,11 @@
 
         for(int i = 0; i < posPrinters.length; i++) {
             // Remove the header lines
             if (posPrinters[i].startsWith("---") ||
                 posPrinters[i].startsWith("Queue") ||
-                posPrinters[i].equals("")) continue;
+                posPrinters[i].isEmpty()) continue;
 
             // Check if there is a ":" in the end of the first colomn.
             // This means that it is not a valid printer definition.
             splitPart = posPrinters[i].split(" ");
             if(splitPart.length >= 1 && !splitPart[0].trim().endsWith(":")) {

@@ -692,22 +692,22 @@
         } else if (category == JobSheets.class) {
             return JobSheets.STANDARD;
         } else if (category == Media.class) {
             String defaultCountry = Locale.getDefault().getCountry();
             if (defaultCountry != null &&
-                (defaultCountry.equals("") ||
+                (defaultCountry.isEmpty() ||
                  defaultCountry.equals(Locale.US.getCountry()) ||
                  defaultCountry.equals(Locale.CANADA.getCountry()))) {
                 return MediaSizeName.NA_LETTER;
             } else {
                  return MediaSizeName.ISO_A4;
             }
         } else if (category == MediaPrintableArea.class) {
             String defaultCountry = Locale.getDefault().getCountry();
             float iw, ih;
             if (defaultCountry != null &&
-                (defaultCountry.equals("") ||
+                (defaultCountry.isEmpty() ||
                  defaultCountry.equals(Locale.US.getCountry()) ||
                  defaultCountry.equals(Locale.CANADA.getCountry()))) {
                 iw = MediaSize.NA.LETTER.getX(Size2DSyntax.INCH) - 0.5f;
                 ih = MediaSize.NA.LETTER.getY(Size2DSyntax.INCH) - 0.5f;
             } else {

@@ -995,11 +995,11 @@
                      flavor.equals(DocFlavor.BYTE_ARRAY.POSTSCRIPT))) &&
                 isSupportedCopies((Copies)attr);
         } else if (attr.getCategory() == Destination.class) {
             URI uri = ((Destination)attr).getURI();
                 if ("file".equals(uri.getScheme()) &&
-                    !(uri.getSchemeSpecificPart().equals(""))) {
+                    !uri.getSchemeSpecificPart().isEmpty()) {
                 return true;
             } else {
             return false;
             }
         } else if (attr.getCategory() == Media.class) {
< prev index next >