--- old/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java 2019-05-02 04:36:02.000000000 -0700 +++ new/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java 2019-05-02 04:36:02.000000000 -0700 @@ -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);