< prev index next >

src/java.desktop/unix/classes/sun/print/UnixPrintJob.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

@@ -392,11 +392,11 @@
 
         IPPPrintService.debug_println(debugPrefix+"mOptions "+mOptions);
         String repClassName = flavor.getRepresentationClassName();
         String val = flavor.getParameter("charset");
         String encoding = "us-ascii";
-        if (val != null && !val.equals("")) {
+        if (val != null && !val.isEmpty()) {
             encoding = val;
         }
 
         if (flavor.equals(DocFlavor.INPUT_STREAM.GIF) ||
             flavor.equals(DocFlavor.INPUT_STREAM.JPEG) ||

@@ -731,11 +731,11 @@
         try {
           userName = System.getProperty("user.name");
         } catch (SecurityException se) {
         }
 
-        if (userName == null || userName.equals("")) {
+        if (userName == null || userName.isEmpty()) {
             RequestingUserName ruName =
                 (RequestingUserName)reqSet.get(RequestingUserName.class);
             if (ruName != null) {
                 jobAttrSet.add(
                     new JobOriginatingUserName(ruName.getValue(),

@@ -863,19 +863,19 @@
         String[] execCmd;
         int ncomps = 2; // minimum number of print args
         int n = 0;
 
         // conveniently "lp" is the default destination for both lp and lpr.
-        if (printer != null && !printer.equals("") && !printer.equals("lp")) {
+        if (printer != null && !printer.isEmpty() && !printer.equals("lp")) {
             pFlags |= PRINTER;
             ncomps+=1;
         }
-        if (options != null && !options.equals("")) {
+        if (options != null && !options.isEmpty()) {
             pFlags |= OPTIONS;
             ncomps+=1;
         }
-        if (jobTitle != null && !jobTitle.equals("")) {
+        if (jobTitle != null && !jobTitle.isEmpty()) {
             pFlags |= JOBTITLE;
             ncomps+=1;
         }
         if (copies > 1) {
             pFlags |= COPIES;
< prev index next >