8223237: Replace use of string.equals("") with isEmpty() in java.desktop

Reviewed-by: prr
diff --git a/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/InputImageTests.java b/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/InputImageTests.java
index 1ca0d42..55a5d10 100644
--- a/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/InputImageTests.java
+++ b/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/InputImageTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -184,7 +184,7 @@
             String klass = spi.getClass().getName();
             String format = spi.getFormatNames()[0].toLowerCase();
             String suffix = spi.getFileSuffixes()[0].toLowerCase();
-            if (suffix == null || suffix.equals("")) {
+            if (suffix == null || suffix.isEmpty()) {
                 suffix = format;
             }
             String shortName;
diff --git a/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/OutputImageTests.java b/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/OutputImageTests.java
index 1fb6353..eaee558 100644
--- a/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/OutputImageTests.java
+++ b/src/demo/share/java2d/J2DBench/src/j2dbench/tests/iio/OutputImageTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -143,7 +143,7 @@
             String klass = spi.getClass().getName();
             String format = spi.getFormatNames()[0].toLowerCase();
             String suffix = spi.getFileSuffixes()[0].toLowerCase();
-            if (suffix == null || suffix.equals("")) {
+            if (suffix == null || suffix.isEmpty()) {
                 suffix = format;
             }
             String shortName;
diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java
index b173ee1..b4e9c17 100644
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -308,7 +308,7 @@
             textRect.width = 50;
         }
 
-        if (text != null && !text.equals("")) {
+        if (text != null && !text.isEmpty()) {
             final View v = (View)c.getClientProperty(BasicHTML.propertyKey);
             if (v != null) {
                 v.paint(g, textRect);
diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java
index cf1025f..a320d05 100644
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -52,7 +52,7 @@
         final Dimension size;
 
         final String text = getText();
-        if ((text == null) || ("".equals(text))) {
+        if (text == null || text.isEmpty()) {
             setText(" ");
             size = super.getPreferredSize();
             setText("");
diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java
index dc13de4..5205822 100644
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -840,7 +840,7 @@
     File makeFile(final JFileChooser fc, final String filename) {
         File selectedFile = null;
         // whitespace is legal on Macs, even on beginning and end of filename
-        if (filename != null && !filename.equals("")) {
+        if (filename != null && !filename.isEmpty()) {
             final FileSystemView fs = fc.getFileSystemView();
             selectedFile = fs.createFileObject(filename);
             if (!selectedFile.isAbsolute()) {
@@ -853,7 +853,7 @@
     // Utility to tell if the textfield has anything in it
     boolean textfieldIsValid() {
         final String s = getFileName();
-        return (s != null && !s.equals(""));
+        return (s != null && !s.isEmpty());
     }
 
     // Action to attach to the file list so we can override the default action
@@ -1960,7 +1960,7 @@
             final String buttonText = fc.getApproveButtonText();
             if (buttonText != null) {
                 buttonText.trim();
-                if (!buttonText.equals("")) return buttonText;
+                if (!buttonText.isEmpty()) return buttonText;
             }
             return fallbackText;
         }
@@ -1979,7 +1979,7 @@
             final String tooltipText = fc.getApproveButtonToolTipText();
             if (tooltipText != null) {
                 tooltipText.trim();
-                if (!tooltipText.equals("")) return tooltipText;
+                if (!tooltipText.isEmpty()) return tooltipText;
             }
             return fallbackText;
         }
diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameBorder.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameBorder.java
index 58fc7da..a516571 100644
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameBorder.java
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameBorder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -180,7 +180,7 @@
         int startXPosition = fThisLeftSideTotal;
         boolean wasTextShortened = false;
         // shorten the string to fit in the
-        if ((text != null) && !(text.equals(""))) {
+        if (text != null && !text.isEmpty()) {
             totalTextWidth = SwingUtilities.computeStringWidth(fm, text);
             final String clipString = "\u2026";
             if (totalTextWidth > availTextWidth) {
diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameDockIconUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameDockIconUI.java
index 3a40c49..5a54e80 100644
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameDockIconUI.java
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameDockIconUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -141,7 +141,7 @@
     public void mouseEntered(final MouseEvent e) {
         if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != 0) return;
         String title = fFrame.getTitle();
-        if (title == null || title.equals("")) title = "Untitled";
+        if (title == null || title.isEmpty()) title = "Untitled";
         fDockLabel = new DockLabel(title);
         fDockLabel.show(fDesktopIcon);
     }
diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuPainter.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuPainter.java
index 69c22af..be70092 100644
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuPainter.java
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuPainter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -253,9 +253,9 @@
         }
 
         // Draw the accelerator first in case the HTML renderer changes the color
-        if (keyString != null && !keyString.equals("")) {
+        if (keyString != null && !keyString.isEmpty()) {
             final int yAccel = acceleratorRect.y + fm.getAscent();
-            if (modifiersString.equals("")) {
+            if (modifiersString.isEmpty()) {
                 // just draw the keyString
                 SwingUtilities2.drawString(c, g, keyString, acceleratorRect.x, yAccel);
             } else {
@@ -282,7 +282,7 @@
         }
 
         // Draw the Text
-        if (text != null && !text.equals("")) {
+        if (text != null && !text.isEmpty()) {
             final View v = (View)c.getClientProperty(BasicHTML.propertyKey);
             if (v != null) {
                 v.paint(g, textRect);
@@ -342,7 +342,7 @@
         //   r = iconRect.union(textRect);
 
         // Add in the accelerator
-        boolean acceleratorTextIsEmpty = (keyString == null) || keyString.equals("");
+        boolean acceleratorTextIsEmpty = (keyString == null) || keyString.isEmpty();
 
         if (!acceleratorTextIsEmpty) {
             r.width += acceleratorRect.width;
@@ -444,7 +444,7 @@
         // Force it to do "LEFT", then flip the rects if we're right-to-left
         SwingUtilities.layoutCompoundLabel(menuItem, fm, text, icon, verticalAlignment, SwingConstants.LEFT, verticalTextPosition, horizontalTextPosition, viewR, iconR, textR, textIconGap);
 
-        final boolean acceleratorTextIsEmpty = (keyString == null) || keyString.equals("");
+        final boolean acceleratorTextIsEmpty = (keyString == null) || keyString.isEmpty();
 
         if (acceleratorTextIsEmpty) {
             acceleratorR.width = acceleratorR.height = 0;
diff --git a/src/java.desktop/macosx/classes/sun/font/CFontManager.java b/src/java.desktop/macosx/classes/sun/font/CFontManager.java
index 883a6c6..5c2afd7 100644
--- a/src/java.desktop/macosx/classes/sun/font/CFontManager.java
+++ b/src/java.desktop/macosx/classes/sun/font/CFontManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -86,7 +86,7 @@
         String fontName = f.fullName;
         String familyName = f.familyName;
 
-        if (fontName == null || "".equals(fontName)) {
+        if (fontName == null || fontName.isEmpty()) {
             return null;
         }
 
diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java
index 3aca0e5..5fb4dc0 100644
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -99,7 +99,7 @@
                                          boolean bounded, int min, int max)
       throws IIOInvalidTreeException {
         String value = getStringAttribute(node, name, null, required, null);
-        if (value == null || "".equals(value)) {
+        if (value == null || value.isEmpty()) {
             return defaultValue;
         }
 
diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageMetadata.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageMetadata.java
index ef68d13..8ab4b73 100644
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageMetadata.java
+++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageMetadata.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -1284,7 +1284,7 @@
                         if(keywordNode != null) {
                             String keyword = keywordNode.getNodeValue();
                             String value = getAttribute(child, "value");
-                            if(!keyword.equals("") && !value.equals("")) {
+                            if (!keyword.isEmpty() && !value.isEmpty()) {
                                 if(keyword.equalsIgnoreCase("DocumentName")) {
                                     tagNumber =
                                         BaselineTIFFTagSet.TAG_DOCUMENT_NAME;
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java
index 8f9f261..47ab522 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -1269,7 +1269,7 @@
             super(FilePane.ACTION_EDIT_FILE_NAME);
         }
         public void actionPerformed(ActionEvent e) {
-            if (getFileName().equals("")) {
+            if (getFileName().isEmpty()) {
                 return;
             }
             JFileChooser fc = getFileChooser();
diff --git a/src/java.desktop/share/classes/java/awt/FileDialog.java b/src/java.desktop/share/classes/java/awt/FileDialog.java
index 0ad5af3..1649e1b 100644
--- a/src/java.desktop/share/classes/java/awt/FileDialog.java
+++ b/src/java.desktop/share/classes/java/awt/FileDialog.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -444,7 +444,7 @@
      * @see       java.awt.FileDialog#getDirectory
      */
     public void setDirectory(String dir) {
-        this.dir = (dir != null && dir.equals("")) ? null : dir;
+        this.dir = (dir != null && dir.isEmpty()) ? null : dir;
         FileDialogPeer peer = (FileDialogPeer)this.peer;
         if (peer != null) {
             peer.setDirectory(this.dir);
@@ -524,7 +524,7 @@
      * @see      #getFiles
      */
     public void setFile(String file) {
-        this.file = (file != null && file.equals("")) ? null : file;
+        this.file = (file != null && file.isEmpty()) ? null : file;
         FileDialogPeer peer = (FileDialogPeer)this.peer;
         if (peer != null) {
             peer.setFile(this.file);
@@ -605,10 +605,10 @@
         s.defaultReadObject();
 
         // 1.1 Compatibility: "" is not converted to null in 1.1
-        if (dir != null && dir.equals("")) {
+        if (dir != null && dir.isEmpty()) {
             dir = null;
         }
-        if (file != null && file.equals("")) {
+        if (file != null && file.isEmpty()) {
             file = null;
         }
     }
diff --git a/src/java.desktop/share/classes/java/awt/TextComponent.java b/src/java.desktop/share/classes/java/awt/TextComponent.java
index 29e0bb1..ad1bad9 100644
--- a/src/java.desktop/share/classes/java/awt/TextComponent.java
+++ b/src/java.desktop/share/classes/java/awt/TextComponent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -1023,7 +1023,7 @@
         public String getSelectedText() {
             String selText = TextComponent.this.getSelectedText();
             // Fix for 4256662
-            if (selText == null || selText.equals("")) {
+            if (selText == null || selText.isEmpty()) {
                 return null;
             }
             return selText;
diff --git a/src/java.desktop/share/classes/java/beans/EventHandler.java b/src/java.desktop/share/classes/java/beans/EventHandler.java
index 1ab720f..ea7810c 100644
--- a/src/java.desktop/share/classes/java/beans/EventHandler.java
+++ b/src/java.desktop/share/classes/java/beans/EventHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, 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
@@ -371,7 +371,7 @@
     }
 
     private Object applyGetters(Object target, String getters) {
-        if (getters == null || getters.equals("")) {
+        if (getters == null || getters.isEmpty()) {
             return target;
         }
         int firstDot = getters.indexOf('.');
diff --git a/src/java.desktop/share/classes/javax/swing/JEditorPane.java b/src/java.desktop/share/classes/javax/swing/JEditorPane.java
index b0afdc0..50702ee 100644
--- a/src/java.desktop/share/classes/javax/swing/JEditorPane.java
+++ b/src/java.desktop/share/classes/javax/swing/JEditorPane.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -1420,7 +1420,7 @@
         try {
             Document doc = getDocument();
             doc.remove(0, doc.getLength());
-            if (t == null || t.equals("")) {
+            if (t == null || t.isEmpty()) {
                 return;
             }
             Reader r = new StringReader(t);
diff --git a/src/java.desktop/share/classes/javax/swing/SwingUtilities.java b/src/java.desktop/share/classes/javax/swing/SwingUtilities.java
index 54fbbd2..9dcb5d5 100644
--- a/src/java.desktop/share/classes/javax/swing/SwingUtilities.java
+++ b/src/java.desktop/share/classes/javax/swing/SwingUtilities.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -1100,7 +1100,7 @@
          * and use 0,0,0,0 for textR.
          */
 
-        boolean textIsEmpty = (text == null) || text.equals("");
+        boolean textIsEmpty = (text == null) || text.isEmpty();
         int lsb = 0;
         int rsb = 0;
         /* Unless both text and icon are non-null, we effectively ignore
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java
index 1146e46..85c6caf 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -275,7 +275,7 @@
             paintIcon(g,c,iconRect);
         }
 
-        if (text != null && !text.equals("")){
+        if (text != null && !text.isEmpty()){
             View v = (View) c.getClientProperty(BasicHTML.propertyKey);
             if (v != null) {
                 v.paint(g, textRect);
@@ -495,7 +495,7 @@
         super.getBaseline(c, width, height);
         AbstractButton b = (AbstractButton)c;
         String text = b.getText();
-        if (text == null || "".equals(text)) {
+        if (text == null || text.isEmpty()) {
             return -1;
         }
         FontMetrics fm = b.getFontMetrics(b.getFont());
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java
index 3fa7f8d..76da80e 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -79,7 +79,7 @@
     public Dimension getPreferredSize() {
         Dimension size;
 
-        if ((this.getText() == null) || (this.getText().equals( "" ))) {
+        if (this.getText() == null || this.getText().isEmpty()) {
             setText( " " );
             size = super.getPreferredSize();
             setText( "" );
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java
index 436265d..5c506ac 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -304,7 +304,7 @@
         super.getBaseline(c, width, height);
         JLabel label = (JLabel)c;
         String text = label.getText();
-        if (text == null || "".equals(text) || label.getFont() == null) {
+        if (text == null || text.isEmpty() || label.getFont() == null) {
             return -1;
         }
         FontMetrics fm = label.getFontMetrics(label.getFont());
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java
index 24a2fb1..fc3859f 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -716,7 +716,7 @@
 
     private void paintAccText(Graphics g, MenuItemLayoutHelper lh,
                               MenuItemLayoutHelper.LayoutResult lr) {
-        if (!lh.getAccText().equals("")) {
+        if (!lh.getAccText().isEmpty()) {
             ButtonModel model = lh.getMenuItem().getModel();
             g.setFont(lh.getAccFontMetrics().getFont());
             if (!model.isEnabled()) {
@@ -754,7 +754,7 @@
 
     private void paintText(Graphics g, MenuItemLayoutHelper lh,
                            MenuItemLayoutHelper.LayoutResult lr) {
-        if (!lh.getText().equals("")) {
+        if (!lh.getText().isEmpty()) {
             if (lh.getHtmlView() != null) {
                 // Text is HTML
                 lh.getHtmlView().paint(g, lr.getTextRect());
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java
index e28fd6c..605a86e 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -119,7 +119,7 @@
         }
 
         // Draw the Text
-        if(text != null && !text.equals("")) {
+        if (text != null && !text.isEmpty()) {
             View v = (View) c.getClientProperty(BasicHTML.propertyKey);
             if (v != null) {
                v.paint(g, textRect);
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java
index 5296cfd..2e50057 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -187,7 +187,7 @@
                                            insets.top+insets.bottom);
         String text = ((JToolTip)c).getTipText();
 
-        if ((text == null) || text.equals("")) {
+        if (text == null) {
             text = "";
         }
         else {
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalButtonUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalButtonUI.java
index db31cc1..0dbaca9 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalButtonUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalButtonUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -202,7 +202,7 @@
         boolean isIcon = b.getIcon() != null;
 
         // If there is text
-        if ( text != null && !text.equals( "" ) ) {
+        if ( text != null && !text.isEmpty()) {
             if ( !isIcon ) {
                 focusRect.setBounds( textRect );
             }
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java
index d8375ce..15f50e9 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -224,7 +224,7 @@
         boolean isIcon = b.getIcon() != null;
 
         // If there is text
-        if ( text != null && !text.equals( "" ) ) {
+        if ( text != null && !text.isEmpty()) {
             if ( !isIcon ) {
                 focusRect.setBounds( textRect );
             }
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java
index d753708..ce80e39 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -132,7 +132,7 @@
             accelBL = metrics.getAscent();
         }
 
-        if (!accelString.equals("")) {
+        if (!accelString.isEmpty()) {
             g.setFont(smallFont);
             g.setColor( MetalLookAndFeel.getPrimaryControlDarkShadow() );
             SwingUtilities2.drawString(tip, g, accelString,
@@ -145,7 +145,7 @@
     }
 
     private int calcAccelSpacing(JComponent c, FontMetrics fm, String accel) {
-        return accel.equals("")
+        return accel.isEmpty()
                ? 0
                : padSpaceBetweenStrings +
                  SwingUtilities2.stringWidth(c, fm, accel);
@@ -155,7 +155,7 @@
         Dimension d = super.getPreferredSize(c);
 
         String key = getAcceleratorString((JToolTip)c);
-        if (!(key.equals(""))) {
+        if (!key.isEmpty()) {
             d.width += calcAccelSpacing(c, c.getFontMetrics(smallFont), key);
         }
         return d;
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthButtonUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthButtonUI.java
index 1d9b685..f99cc65 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthButtonUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthButtonUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -195,7 +195,7 @@
         }
         AbstractButton b = (AbstractButton)c;
         String text = b.getText();
-        if (text == null || "".equals(text)) {
+        if (text == null || text.isEmpty()) {
             return -1;
         }
         Insets i = b.getInsets();
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java
index 844120b..00b0a3c 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -638,7 +638,7 @@
     static void paintAccText(Graphics g, SynthMenuItemLayoutHelper lh,
                              MenuItemLayoutHelper.LayoutResult lr) {
         String accText = lh.getAccText();
-        if (accText != null && !accText.equals("")) {
+        if (accText != null && !accText.isEmpty()) {
             g.setColor(lh.getAccStyle().getColor(lh.getAccContext(),
                     ColorType.TEXT_FOREGROUND));
             g.setFont(lh.getAccStyle().getFont(lh.getAccContext()));
@@ -649,7 +649,7 @@
 
     static void paintText(Graphics g, SynthMenuItemLayoutHelper lh,
                           MenuItemLayoutHelper.LayoutResult lr) {
-        if (!lh.getText().equals("")) {
+        if (!lh.getText().isEmpty()) {
             if (lh.getHtmlView() != null) {
                 // Text is HTML
                 lh.getHtmlView().paint(g, lr.getTextRect());
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthLabelUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthLabelUI.java
index 4d5b900..1a1cbd6 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthLabelUI.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthLabelUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -115,7 +115,7 @@
         }
         JLabel label = (JLabel)c;
         String text = label.getText();
-        if (text == null || "".equals(text)) {
+        if (text == null || text.isEmpty()) {
             return -1;
         }
         Insets i = label.getInsets();
diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthMenuItemLayoutHelper.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthMenuItemLayoutHelper.java
index 0e4a0af..0678d10 100644
--- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthMenuItemLayoutHelper.java
+++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthMenuItemLayoutHelper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -134,7 +134,7 @@
         }
 
         // accRect
-        if (!getAccText().equals("")) {
+        if (!getAccText().isEmpty()) {
              getAccSize().setWidth(accGu.computeStringWidth(getAccContext(),
                     getAccFontMetrics().getFont(), getAccFontMetrics(),
                     getAccText()));
@@ -144,7 +144,7 @@
         // textRect
         if (getText() == null) {
             setText("");
-        } else if (!getText().equals("")) {
+        } else if (!getText().isEmpty()) {
             if (getHtmlView() != null) {
                 // Text is HTML
                 getTextSize().setWidth(
diff --git a/src/java.desktop/share/classes/javax/swing/text/html/FormView.java b/src/java.desktop/share/classes/javax/swing/text/html/FormView.java
index b9ba06d..4ef4b50 100644
--- a/src/java.desktop/share/classes/javax/swing/text/html/FormView.java
+++ b/src/java.desktop/share/classes/javax/swing/text/html/FormView.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -602,7 +602,7 @@
         String name = (String) getElement().getAttributes().getAttribute(HTML.Attribute.NAME);
 
         String data;
-        if (name == null || name.equals("")) {
+        if (name == null || name.isEmpty()) {
             data = "x="+ x +"&y="+ y;
         } else {
             name = URLEncoder.encode(name);
diff --git a/src/java.desktop/share/classes/javax/swing/text/html/FrameView.java b/src/java.desktop/share/classes/javax/swing/text/html/FrameView.java
index 7bf7b7b..1baf157 100644
--- a/src/java.desktop/share/classes/javax/swing/text/html/FrameView.java
+++ b/src/java.desktop/share/classes/javax/swing/text/html/FrameView.java
@@ -69,7 +69,7 @@
         AttributeSet attributes = elem.getAttributes();
         String srcAtt = (String)attributes.getAttribute(HTML.Attribute.SRC);
 
-        if ((srcAtt != null) && (!srcAtt.equals(""))) {
+        if (srcAtt != null && !srcAtt.isEmpty()) {
             try {
                 URL base = ((HTMLDocument)elem.getDocument()).getBase();
                 src = new URL(base, srcAtt);
diff --git a/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java b/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java
index e2f1966..02b5616 100644
--- a/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java
+++ b/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -939,10 +939,10 @@
             } else {
                 String target = (anchor != null) ?
                     (String)anchor.getAttribute(HTML.Attribute.TARGET) : null;
-                if ((target == null) || (target.equals(""))) {
+                if (target == null || target.isEmpty()) {
                     target = hdoc.getBaseTarget();
                 }
-                if ((target == null) || (target.equals(""))) {
+                if (target == null || target.isEmpty()) {
                     target = "_self";
                 }
                     linkEvent = new HTMLFrameHyperlinkEvent(
diff --git a/src/java.desktop/share/classes/sun/awt/DebugSettings.java b/src/java.desktop/share/classes/sun/awt/DebugSettings.java
index 50f4aeb..27e7e66 100644
--- a/src/java.desktop/share/classes/sun/awt/DebugSettings.java
+++ b/src/java.desktop/share/classes/sun/awt/DebugSettings.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -162,7 +162,7 @@
 
         // check if the user specified a particular settings file
         propPath = System.getProperty(PREFIX + "." + PROP_FILE, "");
-        if (propPath.equals("")) {
+        if (propPath.isEmpty()) {
         // otherwise get it from the user's home directory
             propPath = System.getProperty("user.home", "") +
                         File.separator +
diff --git a/src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java b/src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java
index fe533f4..5305195 100644
--- a/src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java
+++ b/src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -569,9 +569,9 @@
         String country = locale.getCountry();
         String variant = locale.getVariant();
         String localePath = null;
-        if (!variant.equals("")) {
+        if (!variant.isEmpty()) {
             localePath = "_" + language + "/_" + country + "/_" + variant;
-        } else if (!country.equals("")) {
+        } else if (!country.isEmpty()) {
             localePath = "_" + language + "/_" + country;
         } else {
             localePath = "_" + language;
diff --git a/src/java.desktop/share/classes/sun/awt/im/InputContext.java b/src/java.desktop/share/classes/sun/awt/im/InputContext.java
index ad9d71b..9a84787 100644
--- a/src/java.desktop/share/classes/sun/awt/im/InputContext.java
+++ b/src/java.desktop/share/classes/sun/awt/im/InputContext.java
@@ -773,7 +773,7 @@
                                           getStartupLocale());
         }
 
-        if (inputMethodInfo != null && !inputMethodInfo.equals("")) {
+        if (inputMethodInfo != null && !inputMethodInfo.isEmpty()) {
             return inputMethodInfo;
         }
 
diff --git a/src/java.desktop/share/classes/sun/font/SunFontManager.java b/src/java.desktop/share/classes/sun/font/SunFontManager.java
index baf62a2..571dfe7 100644
--- a/src/java.desktop/share/classes/sun/font/SunFontManager.java
+++ b/src/java.desktop/share/classes/sun/font/SunFontManager.java
@@ -645,7 +645,7 @@
 
         String fontName = f.fullName;
         String familyName = f.familyName;
-        if (fontName == null || "".equals(fontName)) {
+        if (fontName == null || fontName.isEmpty()) {
             return null;
         }
         if (compositeFonts.containsKey(fontName)) {
diff --git a/src/java.desktop/share/classes/sun/print/PSPrinterJob.java b/src/java.desktop/share/classes/sun/print/PSPrinterJob.java
index 80ec025..20b66e8 100644
--- a/src/java.desktop/share/classes/sun/print/PSPrinterJob.java
+++ b/src/java.desktop/share/classes/sun/print/PSPrinterJob.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -1594,15 +1594,15 @@
         int ncomps = 2; // minimum number of print args
         int n = 0;
 
-        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;
         }
diff --git a/src/java.desktop/share/classes/sun/print/PSStreamPrintJob.java b/src/java.desktop/share/classes/sun/print/PSStreamPrintJob.java
index 3d848fa5..4fcc644 100644
--- a/src/java.desktop/share/classes/sun/print/PSStreamPrintJob.java
+++ b/src/java.desktop/share/classes/sun/print/PSStreamPrintJob.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, 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
@@ -451,7 +451,7 @@
         } catch (SecurityException se) {
         }
 
-        if (userName == null || userName.equals("")) {
+        if (userName == null || userName.isEmpty()) {
             RequestingUserName ruName =
                 (RequestingUserName)reqSet.get(RequestingUserName.class);
             if (ruName != null) {
diff --git a/src/java.desktop/share/classes/sun/print/PSStreamPrintService.java b/src/java.desktop/share/classes/sun/print/PSStreamPrintService.java
index 4e000e0..d221522 100644
--- a/src/java.desktop/share/classes/sun/print/PSStreamPrintService.java
+++ b/src/java.desktop/share/classes/sun/print/PSStreamPrintService.java
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -212,7 +212,7 @@
         } 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;
@@ -224,7 +224,7 @@
             float iw, ih;
             float margin = 0.5f; // both these papers > 5" in all dimensions
             if (defaultCountry != null &&
-                (defaultCountry.equals("") ||
+                (defaultCountry.isEmpty() ||
                  defaultCountry.equals(Locale.US.getCountry()) ||
                  defaultCountry.equals(Locale.CANADA.getCountry()))) {
                 iw = MediaSize.NA.LETTER.getX(Size2DSyntax.INCH) - 2*margin;
diff --git a/src/java.desktop/share/classes/sun/print/PrintJob2D.java b/src/java.desktop/share/classes/sun/print/PrintJob2D.java
index f2e9f03..a2dd763 100644
--- a/src/java.desktop/share/classes/sun/print/PrintJob2D.java
+++ b/src/java.desktop/share/classes/sun/print/PrintJob2D.java
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -683,7 +683,7 @@
                 URI uri = null;
                 try {
                     if (fileName != null) {
-                        if (fileName.equals("")) {
+                        if (fileName.isEmpty()) {
                             fileName = ".";
                         }
                     } else {
@@ -1233,11 +1233,11 @@
             (jobAttributes.getDestination() == DestinationType.PRINTER) ?
                           PRINTER : FILE);
         str = jobAttributes.getPrinter();
-        if (str != null && !str.equals("")) {
+        if (str != null && !str.isEmpty()) {
             props.setProperty(PRINTER_PROP, str);
         }
         str = jobAttributes.getFileName();
-        if (str != null && !str.equals("")) {
+        if (str != null && !str.isEmpty()) {
             props.setProperty(FILENAME_PROP, str);
         }
         int copies = jobAttributes.getCopies();
@@ -1245,7 +1245,7 @@
             props.setProperty(NUMCOPIES_PROP, "" + copies);
         }
         str = this.options;
-        if (str != null && !str.equals("")) {
+        if (str != null && !str.isEmpty()) {
             props.setProperty(OPTIONS_PROP, str);
         }
         props.setProperty(ORIENT_PROP,
diff --git a/src/java.desktop/share/classes/sun/print/ServiceDialog.java b/src/java.desktop/share/classes/sun/print/ServiceDialog.java
index 7e5cba3..016eb43 100644
--- a/src/java.desktop/share/classes/sun/print/ServiceDialog.java
+++ b/src/java.desktop/share/classes/sun/print/ServiceDialog.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, 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
@@ -1395,7 +1395,7 @@
             String unitsKey = "label.millimetres";
             String defaultCountry = Locale.getDefault().getCountry();
             if (defaultCountry != null &&
-                (defaultCountry.equals("") ||
+                (defaultCountry.isEmpty() ||
                  defaultCountry.equals(Locale.US.getCountry()) ||
                  defaultCountry.equals(Locale.CANADA.getCountry()))) {
                 unitsKey = "label.inches";
diff --git a/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java b/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java
index f263f2b..ff2898d 100644
--- a/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java
+++ b/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -256,7 +256,7 @@
         }
 
         // accRect
-        if (!accText.equals("")) {
+        if (!accText.isEmpty()) {
             accSize.width = SwingUtilities2.stringWidth(mi, accFm, accText);
             accSize.height = accFm.getHeight();
         }
@@ -264,7 +264,7 @@
         // textRect
         if (text == null) {
             text = "";
-        } else if (!text.equals("")) {
+        } else if (!text.isEmpty()) {
             if (htmlView != null) {
                 // Text is HTML
                 textSize.width =
diff --git a/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java b/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java
index 5ba53ed..47f9f7e 100644
--- a/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java
+++ b/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -382,7 +382,7 @@
      */
     public static float stringWidth(JComponent c, FontMetrics fm, String string,
             boolean useFPAPI){
-        if (string == null || string.equals("")) {
+        if (string == null || string.isEmpty()) {
             return 0;
         }
         boolean needsTextLayout = ((c != null) &&
@@ -415,7 +415,7 @@
     public static String clipStringIfNecessary(JComponent c, FontMetrics fm,
                                                String string,
                                                int availTextWidth) {
-        if ((string == null) || (string.equals("")))  {
+        if (string == null || string.isEmpty())  {
             return "";
         }
         int textWidth = SwingUtilities2.stringWidth(c, fm, string);
diff --git a/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java b/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java
index 6767719..9760dad 100644
--- a/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java
+++ b/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -321,7 +321,7 @@
 
             resetGlobFilter();
 
-            if (fileName == null || fileName.equals("") ||
+            if (fileName == null || fileName.isEmpty() ||
                     (chooser.isMultiSelectionEnabled() && fileName.startsWith("\""))) {
                 return;
             }
diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java
index 52e8e33..66cd5f8 100644
--- a/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -208,7 +208,7 @@
     }
 
     protected String getWMName() {
-        if (winAttr.title == null || winAttr.title.trim().equals("")) {
+        if (winAttr.title == null || winAttr.title.trim().isEmpty()) {
             return " ";
         } else {
             return winAttr.title;
@@ -220,7 +220,7 @@
         try {
             super.updateWMName();
             String name = getWMName();
-            if (name == null || name.trim().equals("")) {
+            if (name == null || name.trim().isEmpty()) {
                 name = "Java";
             }
             XAtom iconNameAtom = XAtom.get(XAtom.XA_WM_ICON_NAME);
diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XFileDialogPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XFileDialogPeer.java
index fb0fd0b..7efbc22 100644
--- a/src/java.desktop/unix/classes/sun/awt/X11/XFileDialogPeer.java
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XFileDialogPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -461,7 +461,7 @@
             // Here we restoring Motif behaviour
             setSelectionField(target.getFile());
 
-            if (f.equals("")) {
+            if (f.isEmpty()) {
                 f = "*";
                 setFilterField(f);
             } else {
diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java
index a4d7c86..fb30839 100644
--- a/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -233,7 +233,7 @@
      */
     protected Dimension getCaptionSize() {
         String s = getTargetLabel();
-        if (s.equals("")) {
+        if (s.isEmpty()) {
             return null;
         }
         Graphics g = getGraphics();
@@ -260,7 +260,7 @@
      */
     protected void paintCaption(Graphics g, Rectangle rect) {
         String s = getTargetLabel();
-        if (s.equals("")) {
+        if (s.isEmpty()) {
             return;
         }
         g.setFont(getTargetFont());
diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java b/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java
index 8e83b76..d35176f 100644
--- a/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -423,7 +423,7 @@
             if (bottom >= 0) {
                 mainClassName = trace[bottom].getClassName();
             }
-            if (mainClassName == null || mainClassName.equals("")) {
+            if (mainClassName == null || mainClassName.isEmpty()) {
                 mainClassName = "AWT";
             }
             awtAppClassName = getCorrectXIDString(mainClassName);
diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java
index 80ac424..6d4f65c 100644
--- a/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -208,7 +208,7 @@
 
     protected String getWMName() {
         String name = target.getName();
-        if (name == null || name.trim().equals("")) {
+        if (name == null || name.trim().isEmpty()) {
             name = " ";
         }
         return name;
diff --git a/src/java.desktop/unix/classes/sun/awt/X11InputMethodBase.java b/src/java.desktop/unix/classes/sun/awt/X11InputMethodBase.java
index 02e3cf6..2829380 100644
--- a/src/java.desktop/unix/classes/sun/awt/X11InputMethodBase.java
+++ b/src/java.desktop/unix/classes/sun/awt/X11InputMethodBase.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -511,7 +511,7 @@
             flush += composedText.toString();
         }
 
-        if (!flush.equals("")) {
+        if (!flush.isEmpty()) {
             AttributedString attrstr = new AttributedString(flush);
             postInputMethodEvent(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
                                  attrstr.getIterator(),
diff --git a/src/java.desktop/unix/classes/sun/font/FontConfigManager.java b/src/java.desktop/unix/classes/sun/font/FontConfigManager.java
index f45dc09..6c197c6 100644
--- a/src/java.desktop/unix/classes/sun/font/FontConfigManager.java
+++ b/src/java.desktop/unix/classes/sun/font/FontConfigManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -143,7 +143,7 @@
         Locale l = SunToolkit.getStartupLocale();
         String localeStr = l.getLanguage();
         String country = l.getCountry();
-        if (!country.equals("")) {
+        if (!country.isEmpty()) {
             localeStr = localeStr + "-" + country;
         }
         return localeStr;
diff --git a/src/java.desktop/unix/classes/sun/print/IPPPrintService.java b/src/java.desktop/unix/classes/sun/print/IPPPrintService.java
index 92b050e..ca8441e 100644
--- a/src/java.desktop/unix/classes/sun/print/IPPPrintService.java
+++ b/src/java.desktop/unix/classes/sun/print/IPPPrintService.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -1346,7 +1346,7 @@
                 flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
                 URI uri = ((Destination)attr).getURI();
                 if ("file".equals(uri.getScheme()) &&
-                    !(uri.getSchemeSpecificPart().equals(""))) {
+                    !uri.getSchemeSpecificPart().isEmpty()) {
                     return true;
                 }
             }
@@ -1503,7 +1503,7 @@
             if (mediaSizeNames.length == 0) {
                 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;
@@ -1540,7 +1540,7 @@
                  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;
diff --git a/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java b/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java
index 93f6532..121a76e 100644
--- a/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java
+++ b/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, 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
@@ -457,7 +457,7 @@
      */
     private PrintService getServiceByName(PrinterName nameAttr) {
         String name = nameAttr.getValue();
-        if (name == null || name.equals("") || !checkPrinterName(name)) {
+        if (name == null || name.isEmpty() || !checkPrinterName(name)) {
             return null;
         }
         /* check if all printers are already available */
@@ -823,7 +823,7 @@
         for (int i=0; i < names.length; i++) {
             if (!names[i].equals("_default") &&
                 !names[i].equals(defaultPrinter) &&
-                !names[i].equals("")) {
+                !names[i].isEmpty()) {
                 printerNames.add(names[i]);
             }
         }
diff --git a/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java b/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java
index 4a5785e..038635d 100644
--- a/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java
+++ b/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -394,7 +394,7 @@
         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;
         }
 
@@ -733,7 +733,7 @@
         } catch (SecurityException se) {
         }
 
-        if (userName == null || userName.equals("")) {
+        if (userName == null || userName.isEmpty()) {
             RequestingUserName ruName =
                 (RequestingUserName)reqSet.get(RequestingUserName.class);
             if (ruName != null) {
@@ -865,15 +865,15 @@
         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;
         }
diff --git a/src/java.desktop/unix/classes/sun/print/UnixPrintService.java b/src/java.desktop/unix/classes/sun/print/UnixPrintService.java
index ff7981b..a312eab 100644
--- a/src/java.desktop/unix/classes/sun/print/UnixPrintService.java
+++ b/src/java.desktop/unix/classes/sun/print/UnixPrintService.java
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -289,7 +289,7 @@
             // 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.
@@ -694,7 +694,7 @@
         } 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;
@@ -705,7 +705,7 @@
             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;
@@ -997,7 +997,7 @@
         } 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;
diff --git a/src/java.desktop/windows/classes/sun/java2d/windows/WindowsFlags.java b/src/java.desktop/windows/classes/sun/java2d/windows/WindowsFlags.java
index 8fc1a82..92ffbbd 100644
--- a/src/java.desktop/windows/classes/sun/java2d/windows/WindowsFlags.java
+++ b/src/java.desktop/windows/classes/sun/java2d/windows/WindowsFlags.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -134,8 +134,8 @@
                 propString.equals("t") ||
                 propString.equals("True") ||
                 propString.equals("T") ||
-                propString.equals("")) // having the prop name alone
-            {                          // is equivalent to true
+                propString.isEmpty()) // having the prop name alone
+            {                         // is equivalent to true
                 returnVal = true;
             } else if (propString.equals("false") ||
                        propString.equals("f") ||
diff --git a/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java b/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java
index ad6b096..464736a 100644
--- a/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java
+++ b/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java
@@ -207,7 +207,7 @@
 
     public synchronized PrintService getPrintServiceByName(String name) {
 
-        if (name == null || name.equals("")) {
+        if (name == null || name.isEmpty()) {
             return null;
         } else {
             /* getPrintServices() is now very fast. */
diff --git a/src/java.desktop/windows/classes/sun/print/Win32PrintJob.java b/src/java.desktop/windows/classes/sun/print/Win32PrintJob.java
index 1933f8b..3ce5544 100644
--- a/src/java.desktop/windows/classes/sun/print/Win32PrintJob.java
+++ b/src/java.desktop/windows/classes/sun/print/Win32PrintJob.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, 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
@@ -622,7 +622,7 @@
         } catch (SecurityException se) {
         }
 
-        if (userName == null || userName.equals("")) {
+        if (userName == null || userName.isEmpty()) {
             RequestingUserName ruName =
                 (RequestingUserName)reqSet.get(RequestingUserName.class);
             if (ruName != null) {
diff --git a/src/java.desktop/windows/classes/sun/print/Win32PrintService.java b/src/java.desktop/windows/classes/sun/print/Win32PrintService.java
index 973e956..79e0df0 100644
--- a/src/java.desktop/windows/classes/sun/print/Win32PrintService.java
+++ b/src/java.desktop/windows/classes/sun/print/Win32PrintService.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, 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
@@ -1536,7 +1536,7 @@
         } else if (category == Destination.class) {
             URI uri = ((Destination)attr).getURI();
             if ("file".equals(uri.getScheme()) &&
-                !(uri.getSchemeSpecificPart().equals(""))) {
+                !uri.getSchemeSpecificPart().isEmpty()) {
                 return true;
             } else {
             return false;