--- old/src/java.base/share/classes/com/sun/java/util/jar/pack/ConstantPool.java 2018-12-06 14:52:50.431812229 -0500 +++ new/src/java.base/share/classes/com/sun/java/util/jar/pack/ConstantPool.java 2018-12-06 14:52:50.259811376 -0500 @@ -1366,7 +1366,7 @@ } if (tag == CONSTANT_Utf8) { // Special case: First Utf8 must always be empty string. - assert(cpMap.length == 0 || cpMap[0].stringValue().equals("")); + assert(cpMap.length == 0 || cpMap[0].stringValue().isEmpty()); } indexByTag[tag] = ix; // decache indexes derived from this one: --- old/src/java.base/share/classes/com/sun/java/util/jar/pack/Driver.java 2018-12-06 14:52:51.215816117 -0500 +++ new/src/java.base/share/classes/com/sun/java/util/jar/pack/Driver.java 2018-12-06 14:52:51.047815284 -0500 @@ -208,7 +208,7 @@ } } - if (logFile != null && !logFile.equals("")) { + if (logFile != null && !logFile.isEmpty()) { if (logFile.equals("-")) { System.setErr(System.out); } else { @@ -246,7 +246,7 @@ } newfile = packfile; // The optional second argument is the source JAR file. - if (jarfile.equals("")) { + if (jarfile.isEmpty()) { // If only one file is given, it is the only JAR. // It serves as both input and output. jarfile = newfile; @@ -352,7 +352,7 @@ if (Utils.isGZIPMagic(Utils.readMagic(inBuf))) { in = new GZIPInputStream(in); } - String outfile = newfile.equals("")? jarfile: newfile; + String outfile = newfile.isEmpty()? jarfile: newfile; OutputStream fileOut; if (outfile.equals("-")) fileOut = System.out; @@ -366,7 +366,7 @@ // At this point, we have a good jarfile (or newfile, if -r) } - if (!bakfile.equals("")) { + if (!bakfile.isEmpty()) { // On success, abort jarfile recovery bracket. new File(bakfile).delete(); bakfile = ""; @@ -374,13 +374,13 @@ } finally { // Close jarfile recovery bracket. - if (!bakfile.equals("")) { + if (!bakfile.isEmpty()) { File jarFile = new File(jarfile); jarFile.delete(); // Win32 requires this, see above new File(bakfile).renameTo(jarFile); } // In all cases, delete temporary *.pack. - if (!tmpfile.equals("")) + if (!tmpfile.isEmpty()) new File(tmpfile).delete(); } } --- old/src/java.base/share/classes/com/sun/java/util/jar/pack/Package.java 2018-12-06 14:52:51.991819965 -0500 +++ new/src/java.base/share/classes/com/sun/java/util/jar/pack/Package.java 2018-12-06 14:52:51.823819132 -0500 @@ -685,7 +685,7 @@ return; // do not choose yet } String canonName = canonicalFileName(); - if (file.nameString.equals("")) { + if (file.nameString.isEmpty()) { file.nameString = canonName; } if (file.nameString.equals(canonName)) { @@ -706,7 +706,7 @@ public java.io.File getFileName(java.io.File parent) { String name = file.name.stringValue(); - if (name.equals("")) + if (name.isEmpty()) name = canonicalFileName(); String fname = name.replace('/', java.io.File.separatorChar); return new java.io.File(parent, fname); @@ -779,7 +779,7 @@ } public boolean isTrivialClassStub() { return isClassStub() - && name.stringValue().equals("") + && name.stringValue().isEmpty() && (modtime == NO_MODTIME || modtime == default_modtime) && (options &~ FO_IS_CLASS_STUB) == 0; } --- old/src/java.base/share/classes/com/sun/java/util/jar/pack/PackageWriter.java 2018-12-06 14:52:52.775823853 -0500 +++ new/src/java.base/share/classes/com/sun/java/util/jar/pack/PackageWriter.java 2018-12-06 14:52:52.599822980 -0500 @@ -646,7 +646,7 @@ return; // nothing to write // The first element must always be the empty string. - assert(cpMap[0].stringValue().equals("")); + assert(cpMap[0].stringValue().isEmpty()); final int SUFFIX_SKIP_1 = 1; final int PREFIX_SKIP_2 = 2; --- old/src/java.base/share/classes/com/sun/java/util/jar/pack/PackerImpl.java 2018-12-06 14:52:53.551827701 -0500 +++ new/src/java.base/share/classes/com/sun/java/util/jar/pack/PackerImpl.java 2018-12-06 14:52:53.383826867 -0500 @@ -237,7 +237,7 @@ final long segmentLimit; { long limit; - if (props.getProperty(Pack200.Packer.SEGMENT_LIMIT, "").equals("")) + if (props.getProperty(Pack200.Packer.SEGMENT_LIMIT, "").isEmpty()) limit = -1; else limit = props.getLong(Pack200.Packer.SEGMENT_LIMIT); --- old/src/java.base/share/classes/java/io/File.java 2018-12-06 14:52:54.295831390 -0500 +++ new/src/java.base/share/classes/java/io/File.java 2018-12-06 14:52:54.127830557 -0500 @@ -257,7 +257,7 @@ */ private File(String child, File parent) { assert parent.path != null; - assert (!parent.path.equals("")); + assert (!parent.path.isEmpty()); this.path = fs.resolve(parent.path, child); this.prefixLength = parent.prefixLength; } @@ -316,7 +316,7 @@ throw new NullPointerException(); } if (parent != null) { - if (parent.equals("")) { + if (parent.isEmpty()) { this.path = fs.resolve(fs.getDefaultParent(), fs.normalize(child)); } else { @@ -359,7 +359,7 @@ throw new NullPointerException(); } if (parent != null) { - if (parent.path.equals("")) { + if (parent.path.isEmpty()) { this.path = fs.resolve(fs.getDefaultParent(), fs.normalize(child)); } else { @@ -426,7 +426,7 @@ if (uri.getRawQuery() != null) throw new IllegalArgumentException("URI has a query component"); String p = uri.getPath(); - if (p.equals("")) + if (p.isEmpty()) throw new IllegalArgumentException("URI path component is empty"); // Okay, now initialize --- old/src/java.base/share/classes/java/lang/SecurityManager.java 2018-12-06 14:52:55.079835278 -0500 +++ new/src/java.base/share/classes/java/lang/SecurityManager.java 2018-12-06 14:52:54.903834405 -0500 @@ -1201,7 +1201,7 @@ private static String[] getPackages(String p) { String packages[] = null; - if (p != null && !p.equals("")) { + if (p != null && !p.isEmpty()) { java.util.StringTokenizer tok = new java.util.StringTokenizer(p, ","); int n = tok.countTokens(); --- old/src/java.base/share/classes/java/lang/System.java 2018-12-06 14:52:55.863839165 -0500 +++ new/src/java.base/share/classes/java/lang/System.java 2018-12-06 14:52:55.695838332 -0500 @@ -970,7 +970,7 @@ if (key == null) { throw new NullPointerException("key can't be null"); } - if (key.equals("")) { + if (key.isEmpty()) { throw new IllegalArgumentException("key can't be empty"); } } --- old/src/java.base/share/classes/java/lang/reflect/Parameter.java 2018-12-06 14:52:56.643843033 -0500 +++ new/src/java.base/share/classes/java/lang/reflect/Parameter.java 2018-12-06 14:52:56.475842200 -0500 @@ -174,9 +174,9 @@ */ public String getName() { // Note: empty strings as parameter names are now outlawed. - // The .equals("") is for compatibility with current JVM + // The .isEmpty() is for compatibility with current JVM // behavior. It may be removed at some point. - if(name == null || name.equals("")) + if(name == null || name.isEmpty()) return "arg" + index; else return name; --- old/src/java.base/share/classes/java/net/HostPortrange.java 2018-12-06 14:52:57.427846921 -0500 +++ new/src/java.base/share/classes/java/net/HostPortrange.java 2018-12-06 14:52:57.255846068 -0500 @@ -241,7 +241,7 @@ int[] parsePort(String port) { - if (port == null || port.equals("")) { + if (port == null || port.isEmpty()) { return defaultPort(); } @@ -260,13 +260,13 @@ String high = port.substring(dash+1); int l,h; - if (low.equals("")) { + if (low.isEmpty()) { l = PORT_MIN; } else { l = Integer.parseInt(low); } - if (high.equals("")) { + if (high.isEmpty()) { h = PORT_MAX; } else { h = Integer.parseInt(high); --- old/src/java.base/share/classes/java/net/InetAddress.java 2018-12-06 14:52:58.195850729 -0500 +++ new/src/java.base/share/classes/java/net/InetAddress.java 2018-12-06 14:52:58.023849876 -0500 @@ -1009,7 +1009,7 @@ + " not found "); } - if ((host == null) || (host.equals("")) || (host.equals(" "))) { + if ((host == null) || (host.isEmpty()) || (host.equals(" "))) { throw new UnknownHostException("Requested address " + addrString + " resolves to an invalid entry in hosts file " @@ -1046,7 +1046,7 @@ hostEntry = removeComments(hostEntry); if (hostEntry.contains(host)) { addrStr = extractHostAddr(hostEntry, host); - if ((addrStr != null) && (!addrStr.equals(""))) { + if ((addrStr != null) && (!addrStr.isEmpty())) { addr = createAddressByteArray(addrStr); if (inetAddresses == null) { inetAddresses = new ArrayList<>(1); --- old/src/java.base/share/classes/java/net/SocketPermission.java 2018-12-06 14:52:58.959854518 -0500 +++ new/src/java.base/share/classes/java/net/SocketPermission.java 2018-12-06 14:52:58.787853665 -0500 @@ -305,7 +305,7 @@ } private static String getHost(String host) { - if (host.equals("")) { + if (host.isEmpty()) { return "localhost"; } else { /* IPv6 literal address used in this context should follow @@ -344,7 +344,7 @@ throws Exception { - if (port == null || port.equals("") || port.equals("*")) { + if (port == null || port.isEmpty() || port.equals("*")) { return new int[] {PORT_MIN, PORT_MAX}; } @@ -358,13 +358,13 @@ String high = port.substring(dash+1); int l,h; - if (low.equals("")) { + if (low.isEmpty()) { l = PORT_MIN; } else { l = Integer.parseInt(low); } - if (high.equals("")) { + if (high.isEmpty()) { h = PORT_MAX; } else { h = Integer.parseInt(high); @@ -496,7 +496,7 @@ throw new NullPointerException("action can't be null"); } - if (action.equals("")) { + if (action.isEmpty()) { throw new IllegalArgumentException("action can't be empty"); } --- old/src/java.base/share/classes/java/net/URLPermission.java 2018-12-06 14:52:59.723858306 -0500 +++ new/src/java.base/share/classes/java/net/URLPermission.java 2018-12-06 14:52:59.559857493 -0500 @@ -533,11 +533,11 @@ String thishost = this.p.hostname(); String thathost = that.p.hostname(); - if (p.wildcard() && thishost.equals("")) { + if (p.wildcard() && thishost.isEmpty()) { // this "*" implies all others return true; } - if (that.p.wildcard() && thathost.equals("")) { + if (that.p.wildcard() && thathost.isEmpty()) { // that "*" can only be implied by this "*" return false; } --- old/src/java.base/share/classes/java/net/URLStreamHandler.java 2018-12-06 14:53:00.491862114 -0500 +++ new/src/java.base/share/classes/java/net/URLStreamHandler.java 2018-12-06 14:53:00.323861281 -0500 @@ -437,7 +437,7 @@ return u.hostAddress; String host = u.getHost(); - if (host == null || host.equals("")) { + if (host == null || host.isEmpty()) { return null; } else { try { --- old/src/java.base/share/classes/java/util/Locale.java 2018-12-06 14:53:01.271865982 -0500 +++ new/src/java.base/share/classes/java/util/Locale.java 2018-12-06 14:53:01.091865090 -0500 @@ -2226,10 +2226,10 @@ default: return Arrays.stream(stringList).reduce("", (s1, s2) -> { - if (s1.equals("")) { + if (s1.isEmpty()) { return s2; } - if (s2.equals("")) { + if (s2.isEmpty()) { return s1; } return MessageFormat.format(pattern, s1, s2); @@ -3069,7 +3069,7 @@ private static boolean isSubtagIllFormed(String subtag, boolean isFirstSubtag) { - if (subtag.equals("") || subtag.length() > 8) { + if (subtag.isEmpty() || subtag.length() > 8) { return true; } else if (subtag.equals("*")) { return false; --- old/src/java.base/share/classes/java/util/jar/Pack200.java 2018-12-06 14:53:02.091870048 -0500 +++ new/src/java.base/share/classes/java/util/jar/Pack200.java 2018-12-06 14:53:01.919869195 -0500 @@ -704,7 +704,7 @@ if (impl == null) { // The first time, we must decide which class to use. implName = GetPropertyAction.privilegedGetProperty(prop,""); - if (implName != null && !implName.equals("")) + if (implName != null && !implName.isEmpty()) impl = Class.forName(implName); else if (PACK_PROVIDER.equals(prop)) impl = com.sun.java.util.jar.pack.PackerImpl.class; --- old/src/java.base/share/classes/java/util/regex/Pattern.java 2018-12-06 14:53:02.875873936 -0500 +++ new/src/java.base/share/classes/java/util/regex/Pattern.java 2018-12-06 14:53:02.707873103 -0500 @@ -1290,7 +1290,7 @@ // Construct result int resultSize = matchList.size(); if (limit == 0) - while (resultSize > 0 && matchList.get(resultSize-1).equals("")) + while (resultSize > 0 && matchList.get(resultSize-1).isEmpty()) resultSize--; String[] result = new String[resultSize]; return matchList.subList(0, resultSize).toArray(result); --- old/src/java.base/share/classes/javax/crypto/Cipher.java 2018-12-06 14:53:03.691877982 -0500 +++ new/src/java.base/share/classes/javax/crypto/Cipher.java 2018-12-06 14:53:03.523877149 -0500 @@ -531,7 +531,7 @@ public static final Cipher getInstance(String transformation) throws NoSuchAlgorithmException, NoSuchPaddingException { - if ((transformation == null) || transformation.equals("")) { + if ((transformation == null) || transformation.isEmpty()) { throw new NoSuchAlgorithmException("Null or empty transformation"); } List transforms = getTransforms(transformation); @@ -631,7 +631,7 @@ throws NoSuchAlgorithmException, NoSuchProviderException, NoSuchPaddingException { - if ((transformation == null) || transformation.equals("")) { + if ((transformation == null) || transformation.isEmpty()) { throw new NoSuchAlgorithmException("Null or empty transformation"); } if ((provider == null) || (provider.length() == 0)) { @@ -698,7 +698,7 @@ Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException { - if ((transformation == null) || transformation.equals("")) { + if ((transformation == null) || transformation.isEmpty()) { throw new NoSuchAlgorithmException("Null or empty transformation"); } if (provider == null) { @@ -2840,4 +2840,4 @@ sb.append(", algorithm from: ").append(getProviderName()); return sb.toString(); } -} \ No newline at end of file +} --- old/src/java.base/share/classes/javax/net/ssl/SSLParameters.java 2018-12-06 14:53:04.475881870 -0500 +++ new/src/java.base/share/classes/javax/net/ssl/SSLParameters.java 2018-12-06 14:53:04.307881037 -0500 @@ -668,7 +668,7 @@ String[] tempProtocols = protocols.clone(); for (String p : tempProtocols) { - if (p == null || p.equals("")) { + if (p == null || p.isEmpty()) { throw new IllegalArgumentException( "An element of protocols was null/empty"); } --- old/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java 2018-12-06 14:53:05.243885678 -0500 +++ new/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java 2018-12-06 14:53:05.071884825 -0500 @@ -97,10 +97,10 @@ JAVA_VERSION = props.getProperty("java.version"); DEBUG = (props.getProperty("sun.misc.URLClassPath.debug") != null); String p = props.getProperty("sun.misc.URLClassPath.disableJarChecking"); - DISABLE_JAR_CHECKING = p != null ? p.equals("true") || p.equals("") : false; + DISABLE_JAR_CHECKING = p != null ? p.equals("true") || p.isEmpty() : false; p = props.getProperty("jdk.net.URLClassPath.disableRestrictedPermissions"); - DISABLE_ACC_CHECKING = p != null ? p.equals("true") || p.equals("") : false; + DISABLE_ACC_CHECKING = p != null ? p.equals("true") || p.isEmpty() : false; // This property will be removed in a later release p = props.getProperty("jdk.net.URLClassPath.disableClassPathURLCheck", "true"); --- old/src/java.base/share/classes/sun/net/www/protocol/jar/URLJarFile.java 2018-12-06 14:53:05.995889407 -0500 +++ new/src/java.base/share/classes/sun/net/www/protocol/jar/URLJarFile.java 2018-12-06 14:53:05.823888554 -0500 @@ -111,7 +111,7 @@ * 'file:' URLs can be accessible through ftp. */ String host = url.getHost(); - if (host == null || host.equals("") || host.equals("~") || + if (host == null || host.isEmpty() || host.equals("~") || host.equalsIgnoreCase("localhost")) return true; } --- old/src/java.base/share/classes/sun/net/www/protocol/mailto/Handler.java 2018-12-06 14:53:06.739893097 -0500 +++ new/src/java.base/share/classes/sun/net/www/protocol/mailto/Handler.java 2018-12-06 14:53:06.571892264 -0500 @@ -127,7 +127,7 @@ * Let's just make sure we DO have an Email address in the URL. */ boolean nogood = false; - if (file == null || file.equals("")) + if (file == null || file.isEmpty()) nogood = true; else { boolean allwhites = true; --- old/src/java.base/share/classes/sun/security/provider/PolicyFile.java 2018-12-06 14:53:07.515896945 -0500 +++ new/src/java.base/share/classes/sun/security/provider/PolicyFile.java 2018-12-06 14:53:07.339896072 -0500 @@ -1608,7 +1608,7 @@ if (u.getProtocol().equals("file")) { boolean isLocalFile = false; String host = u.getHost(); - isLocalFile = (host == null || host.equals("") || + isLocalFile = (host == null || host.isEmpty() || host.equals("~") || host.equalsIgnoreCase("localhost")); if (isLocalFile) { --- old/src/java.base/share/classes/sun/security/util/ConsoleCallbackHandler.java 2018-12-06 14:53:08.299900832 -0500 +++ new/src/java.base/share/classes/sun/security/util/ConsoleCallbackHandler.java 2018-12-06 14:53:08.131899999 -0500 @@ -103,7 +103,7 @@ System.err.flush(); String result = readLine(); - if (result.equals("")) { + if (result.isEmpty()) { result = nc.getDefaultName(); } @@ -212,7 +212,7 @@ prompt = ""; } prompt = prefix + prompt; - if (!prompt.equals("")) { + if (!prompt.isEmpty()) { System.err.println(prompt); } --- old/src/java.base/share/classes/sun/security/util/DomainName.java 2018-12-06 14:53:09.043904522 -0500 +++ new/src/java.base/share/classes/sun/security/util/DomainName.java 2018-12-06 14:53:08.875903689 -0500 @@ -363,7 +363,7 @@ } private static int numLabels(String rule) { - if (rule.equals("")) { + if (rule.isEmpty()) { return 0; } int len = rule.length(); --- old/src/java.base/unix/classes/java/io/UnixFileSystem.java 2018-12-06 14:53:09.791908231 -0500 +++ new/src/java.base/unix/classes/java/io/UnixFileSystem.java 2018-12-06 14:53:09.627907418 -0500 @@ -103,7 +103,7 @@ } public String resolve(String parent, String child) { - if (child.equals("")) return parent; + if (child.isEmpty()) return parent; if (child.charAt(0) == '/') { if (parent.equals("/")) return child; return parent + child; --- old/src/java.base/unix/classes/sun/net/www/protocol/file/Handler.java 2018-12-06 14:53:10.559912039 -0500 +++ new/src/java.base/unix/classes/sun/net/www/protocol/file/Handler.java 2018-12-06 14:53:10.387911186 -0500 @@ -75,7 +75,7 @@ public synchronized URLConnection openConnection(URL u, Proxy p) throws IOException { String host = u.getHost(); - if (host == null || host.equals("") || host.equals("~") || + if (host == null || host.isEmpty() || host.equals("~") || host.equalsIgnoreCase("localhost")) { File file = new File(ParseUtil.decode(u.getPath())); return createFileURLConnection(u, file); --- old/src/java.base/windows/classes/jdk/internal/loader/FileURLMapper.java 2018-12-06 14:53:11.335915887 -0500 +++ new/src/java.base/windows/classes/jdk/internal/loader/FileURLMapper.java 2018-12-06 14:53:11.171915074 -0500 @@ -55,7 +55,7 @@ return file; } String host = url.getHost(); - if (host != null && !host.equals("") && + if (host != null && !host.isEmpty() && !"localhost".equalsIgnoreCase(host)) { String rest = url.getFile(); String s = host + ParseUtil.decode (url.getFile()); --- old/src/java.base/windows/classes/sun/net/www/protocol/file/Handler.java 2018-12-06 14:53:12.107919715 -0500 +++ new/src/java.base/windows/classes/sun/net/www/protocol/file/Handler.java 2018-12-06 14:53:11.943918902 -0500 @@ -83,7 +83,7 @@ path = path.replace('/', '\\'); path = path.replace('|', ':'); - if ((host == null) || host.equals("") || + if ((host == null) || host.isEmpty() || host.equalsIgnoreCase("localhost") || host.equals("~")) { return createFileURLConnection(url, new File(path)); --- old/src/java.base/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java 2018-12-06 14:53:12.879923543 -0500 +++ new/src/java.base/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java 2018-12-06 14:53:12.707922691 -0500 @@ -76,7 +76,7 @@ // Deal with UNC pathnames specially. See 4180841 String host = url.getHost(); - if (host != null && !host.equals("") && + if (host != null && !host.isEmpty() && !host.equalsIgnoreCase("localhost")) { url = new URL("file", "", "//" + host + url.getPath()); --- old/src/java.base/windows/classes/sun/nio/fs/WindowsUriSupport.java 2018-12-06 14:53:13.639927312 -0500 +++ new/src/java.base/windows/classes/sun/nio/fs/WindowsUriSupport.java 2018-12-06 14:53:13.475926499 -0500 @@ -128,12 +128,12 @@ if (uri.getRawQuery() != null) throw new IllegalArgumentException("URI has a query component"); String path = uri.getPath(); - if (path.equals("")) + if (path.isEmpty()) throw new IllegalArgumentException("URI path component is empty"); // UNC String auth = uri.getRawAuthority(); - if (auth != null && !auth.equals("")) { + if (auth != null && !auth.isEmpty()) { String host = uri.getHost(); if (host == null) throw new IllegalArgumentException("URI authority component has undefined host"); --- old/src/java.logging/share/classes/java/util/logging/LogManager.java 2018-12-06 14:53:14.415931160 -0500 +++ new/src/java.logging/share/classes/java/util/logging/LogManager.java 2018-12-06 14:53:14.243930307 -0500 @@ -890,7 +890,7 @@ // Gets a node in our tree of logger nodes. // If necessary, create it. LogNode getNode(String name) { - if (name == null || name.equals("")) { + if (name == null || name.isEmpty()) { return root; } LogNode node = root; @@ -1486,7 +1486,7 @@ // Reset Logger level String name = logger.getName(); - if (name != null && name.equals("")) { + if (name != null && name.isEmpty()) { // This is the root logger. logger.setLevel(defaultLevel); } else { --- old/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java 2018-12-06 14:53:15.203935068 -0500 +++ new/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java 2018-12-06 14:53:15.035934234 -0500 @@ -289,7 +289,7 @@ throw new MalformedURLException(msg); } final String urlPath = url.getURLPath(); - if (!urlPath.equals("") + if (!urlPath.isEmpty() && !urlPath.equals("/") && !urlPath.startsWith("/jndi/")) { final String msg = "URL path must be empty or start with " + @@ -746,7 +746,7 @@ port = 0; } else { protocol = address.getProtocol(); - host = (address.getHost().equals("")) ? null : address.getHost(); + host = (address.getHost().isEmpty()) ? null : address.getHost(); port = address.getPort(); } --- old/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java 2018-12-06 14:53:15.979938916 -0500 +++ new/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java 2018-12-06 14:53:15.811938082 -0500 @@ -114,7 +114,7 @@ // 6238731: set the default domain if no domain is set. ObjectName nn = name; - if (name.getDomain() == null || name.getDomain().equals("")) { + if (name.getDomain() == null || name.getDomain().isEmpty()) { try { nn = ObjectName.getInstance(mbeanServer.getDefaultDomain(), name.getKeyPropertyList()); --- old/src/java.management/share/classes/javax/management/ImmutableDescriptor.java 2018-12-06 14:53:16.723942605 -0500 +++ new/src/java.management/share/classes/javax/management/ImmutableDescriptor.java 2018-12-06 14:53:16.555941772 -0500 @@ -110,7 +110,7 @@ new TreeMap(String.CASE_INSENSITIVE_ORDER); for (Map.Entry entry : fields.entrySet()) { String name = entry.getKey(); - if (name == null || name.equals("")) + if (name == null || name.isEmpty()) throw new IllegalArgumentException("Empty or null field name"); if (map.containsKey(name)) throw new IllegalArgumentException("Duplicate name: " + name); @@ -166,7 +166,7 @@ new TreeMap(String.CASE_INSENSITIVE_ORDER); for (int i = 0; i < fieldNames.length; i++) { String name = fieldNames[i]; - if (name == null || name.equals("")) + if (name == null || name.isEmpty()) throw new IllegalArgumentException("Empty or null field name"); Object old = map.put(name, fieldValues[i]); if (old != null) { @@ -333,7 +333,7 @@ Object[] result = new Object[fieldNames.length]; for (int i = 0; i < fieldNames.length; i++) { String name = fieldNames[i]; - if (name != null && !name.equals("")) + if (name != null && !name.isEmpty()) result[i] = getFieldValue(name); } return result; @@ -543,7 +543,7 @@ } private static void checkIllegalFieldName(String name) { - if (name == null || name.equals("")) + if (name == null || name.isEmpty()) illegal("Null or empty field name"); } --- old/src/java.management/share/classes/javax/management/MBeanPermission.java 2018-12-06 14:53:17.471946314 -0500 +++ new/src/java.management/share/classes/javax/management/MBeanPermission.java 2018-12-06 14:53:17.307945501 -0500 @@ -256,7 +256,7 @@ if (actions == null) throw new IllegalArgumentException("MBeanPermission: " + "actions can't be null"); - if (actions.equals("")) + if (actions.isEmpty()) throw new IllegalArgumentException("MBeanPermission: " + "actions can't be empty"); @@ -279,7 +279,7 @@ throw new IllegalArgumentException("MBeanPermission name " + "cannot be null"); - if (name.equals("")) + if (name.isEmpty()) throw new IllegalArgumentException("MBeanPermission name " + "cannot be empty"); @@ -310,7 +310,7 @@ // String on = name.substring(openingBracket + 1, name.length() - 1); - if (on.equals("")) + if (on.isEmpty()) objectName = ObjectName.WILDCARD; else if (on.equals("-")) objectName = null; @@ -359,7 +359,7 @@ if (className == null || className.equals("-")) { classNamePrefix = null; classNameExactMatch = false; - } else if (className.equals("") || className.equals("*")) { + } else if (className.isEmpty() || className.equals("*")) { classNamePrefix = ""; classNameExactMatch = false; } else if (className.endsWith(".*")) { @@ -375,7 +375,7 @@ private void setMember(String member) { if (member == null || member.equals("-")) this.member = null; - else if (member.equals("")) + else if (member.isEmpty()) this.member = "*"; else this.member = member; --- old/src/java.management/share/classes/javax/management/modelmbean/DescriptorSupport.java 2018-12-06 14:53:18.231950083 -0500 +++ new/src/java.management/share/classes/javax/management/modelmbean/DescriptorSupport.java 2018-12-06 14:53:18.067949269 -0500 @@ -443,7 +443,7 @@ init(null); for (int i=0; i < fields.length; i++) { - if ((fields[i] == null) || (fields[i].equals(""))) { + if ((fields[i] == null) || (fields[i].isEmpty())) { continue; } int eq_separator = fields[i].indexOf('='); @@ -467,7 +467,7 @@ fieldValue = fields[i].substring(eq_separator+1); } - if (fieldName.equals("")) { + if (fieldName.isEmpty()) { if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) { MODELMBEAN_LOGGER.log(Level.TRACE, "Descriptor(String... fields) " + @@ -500,7 +500,7 @@ public synchronized Object getFieldValue(String fieldName) throws RuntimeOperationsException { - if ((fieldName == null) || (fieldName.equals(""))) { + if ((fieldName == null) || (fieldName.isEmpty())) { if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) { MODELMBEAN_LOGGER.log(Level.TRACE, "Illegal arguments: null field name"); @@ -522,7 +522,7 @@ throws RuntimeOperationsException { // field name cannot be null or empty - if ((fieldName == null) || (fieldName.equals(""))) { + if ((fieldName == null) || (fieldName.isEmpty())) { if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) { MODELMBEAN_LOGGER.log(Level.TRACE, "Illegal arguments: null or empty field name"); @@ -664,7 +664,7 @@ responseFields[i++] = value; } else { for (i=0; i < fieldNames.length; i++) { - if ((fieldNames[i] == null) || (fieldNames[i].equals(""))) { + if ((fieldNames[i] == null) || (fieldNames[i].isEmpty())) { responseFields[i] = null; } else { responseFields[i] = getFieldValue(fieldNames[i]); @@ -700,7 +700,7 @@ } for (int i=0; i < fieldNames.length; i++) { - if (( fieldNames[i] == null) || (fieldNames[i].equals(""))) { + if (( fieldNames[i] == null) || (fieldNames[i].isEmpty())) { if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) { MODELMBEAN_LOGGER.log(Level.TRACE, "Null field name encountered at element " + i); @@ -733,7 +733,7 @@ } public synchronized void removeField(String fieldName) { - if ((fieldName == null) || (fieldName.equals(""))) { + if ((fieldName == null) || (fieldName.isEmpty())) { return; } @@ -862,7 +862,7 @@ String thisDescType = (String)(getFieldValue("descriptorType")); if ((thisName == null) || (thisDescType == null) || - (thisName.equals("")) || (thisDescType.equals(""))) { + (thisName.isEmpty()) || (thisDescType.isEmpty())) { return false; } @@ -912,7 +912,7 @@ private boolean validateField(String fldName, Object fldValue) { - if ((fldName == null) || (fldName.equals(""))) + if ((fldName == null) || (fldName.isEmpty())) return false; String SfldValue = ""; boolean isAString = false; @@ -931,7 +931,7 @@ fldName.equalsIgnoreCase("Class")) { if (fldValue == null || !isAString) return false; - if (nameOrDescriptorType && SfldValue.equals("")) + if (nameOrDescriptorType && SfldValue.isEmpty()) return false; return true; } else if (fldName.equalsIgnoreCase("visibility")) { --- old/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java 2018-12-06 14:53:18.991953851 -0500 +++ new/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java 2018-12-06 14:53:18.823953018 -0500 @@ -367,7 +367,7 @@ MODELMBEAN_LOGGER.log(Level.TRACE, "Entry"); } - if ((inDescriptorType == null) || (inDescriptorType.equals(""))) { + if ((inDescriptorType == null) || (inDescriptorType.isEmpty())) { inDescriptorType = "all"; } @@ -600,7 +600,7 @@ inDescriptor = new DescriptorSupport(); } - if ((inDescriptorType == null) || (inDescriptorType.equals(""))) { + if ((inDescriptorType == null) || (inDescriptorType.isEmpty())) { inDescriptorType = (String) inDescriptor.getFieldValue("descriptorType"); --- old/src/java.management/share/classes/javax/management/openmbean/CompositeType.java 2018-12-06 14:53:19.759957660 -0500 +++ new/src/java.management/share/classes/javax/management/openmbean/CompositeType.java 2018-12-06 14:53:19.587956807 -0500 @@ -171,7 +171,7 @@ private static void checkForEmptyString(String[] arg, String argName) { for (int i=0; i 0 || type == void.class || rest.equals("Class")) { --- old/src/java.naming/share/classes/com/sun/jndi/ldap/Filter.java 2018-12-06 14:53:25.867987948 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/ldap/Filter.java 2018-12-06 14:53:25.695987095 -0500 @@ -53,7 +53,7 @@ static void encodeFilterString(BerEncoder ber, String filterStr, boolean isLdapv3) throws IOException, NamingException { - if ((filterStr == null) || (filterStr.equals(""))) { + if ((filterStr == null) || (filterStr.isEmpty())) { throw new InvalidSearchFilterException("Empty filter"); } byte[] filter; --- old/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java 2018-12-06 14:53:26.651991835 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java 2018-12-06 14:53:26.479990983 -0500 @@ -915,7 +915,7 @@ boolean directUpdate) throws NamingException { // Handle the empty name - if (dn.equals("")) { + if (dn.isEmpty()) { return attrs; } @@ -1271,7 +1271,7 @@ int prefixLast = prefix.size() - 1; if (name.isEmpty() || prefix.isEmpty() || - name.get(0).equals("") || prefix.get(prefixLast).equals("")) { + name.get(0).isEmpty() || prefix.get(prefixLast).isEmpty()) { return super.composeName(name, prefix); } @@ -1300,9 +1300,9 @@ // used by LdapSearchEnumeration private static String concatNames(String lesser, String greater) { - if (lesser == null || lesser.equals("")) { + if (lesser == null || lesser.isEmpty()) { return greater; - } else if (greater == null || greater.equals("")) { + } else if (greater == null || greater.isEmpty()) { return lesser; } else { return (lesser + "," + greater); @@ -3036,7 +3036,7 @@ } // extract SLAPD-style referrals from errorMessage - if ((res.errorMessage != null) && (!res.errorMessage.equals(""))) { + if ((res.errorMessage != null) && (!res.errorMessage.isEmpty())) { res.referrals = extractURLs(res.errorMessage); } else { e = new PartialResultException(msg); --- old/src/java.naming/share/classes/com/sun/jndi/ldap/LdapReferralContext.java 2018-12-06 14:53:27.447995783 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/ldap/LdapReferralContext.java 2018-12-06 14:53:27.287994989 -0500 @@ -182,7 +182,7 @@ if (urlString == null) { urlName = null; } else { - urlName = urlString.equals("") ? new CompositeName() : + urlName = urlString.isEmpty() ? new CompositeName() : new CompositeName().add(urlString); } } @@ -888,7 +888,7 @@ // ---------------------- Private methods --------------------- private Name toName(String name) throws InvalidNameException { - return name.equals("") ? new CompositeName() : + return name.isEmpty() ? new CompositeName() : new CompositeName().add(name); } --- old/src/java.naming/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java 2018-12-06 14:53:28.211999571 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java 2018-12-06 14:53:28.047998758 -0500 @@ -97,13 +97,13 @@ // Name relative to search context CompositeName cn = new CompositeName(); - if (!relStart.equals("")) { + if (!relStart.isEmpty()) { cn.add(relStart); } // Name relative to homeCtx CompositeName rcn = new CompositeName(); - if (!relHome.equals("")) { + if (!relHome.isEmpty()) { rcn.add(relHome); } //System.err.println("relStart: " + cn); --- old/src/java.naming/share/classes/com/sun/jndi/ldap/LdapURL.java 2018-12-06 14:53:28.952003241 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/ldap/LdapURL.java 2018-12-06 14:53:28.788002427 -0500 @@ -197,7 +197,7 @@ // path begins with a '/' or is empty - if (path.equals("")) { + if (path.isEmpty()) { return; } --- old/src/java.naming/share/classes/com/sun/jndi/ldap/NamingEventNotifier.java 2018-12-06 14:53:29.728007089 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/ldap/NamingEventNotifier.java 2018-12-06 14:53:29.552006216 -0500 @@ -115,7 +115,7 @@ try { Continuation cont = new Continuation(); cont.setError(this, info.name); - Name nm = (info.name == null || info.name.equals("")) ? + Name nm = (info.name == null || info.name.isEmpty()) ? new CompositeName() : new CompositeName().add(info.name); results = context.searchAux(nm, info.filter, info.controls, --- old/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java 2018-12-06 14:53:30.484010837 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java 2018-12-06 14:53:30.312009984 -0500 @@ -243,7 +243,7 @@ protected boolean isEmpty(String name) { - return name == null || name.equals(""); + return name == null || name.isEmpty(); } // ------ implementations of c_ and c_*_nns methods using @@ -510,7 +510,7 @@ */ protected void a_processJunction_nns(String name, Continuation cont) throws NamingException { - if (name.equals("")) { + if (name.isEmpty()) { NameNotFoundException e = new NameNotFoundException(); cont.setErrorNNS(this, name); throw cont.fillInException(e); --- old/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java 2018-12-06 14:53:31.260014685 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java 2018-12-06 14:53:31.092013852 -0500 @@ -105,7 +105,7 @@ throws NamingException { int separator; // if no name to parse, or if we're already at boundary - if (name.isEmpty() || name.get(0).equals("")) { + if (name.isEmpty() || name.get(0).isEmpty()) { separator = 0; } else { separator = 1; @@ -379,7 +379,7 @@ if (tail == null || tail.isEmpty()) { //System.out.println("terminal : " + head); ret = TERMINAL_COMPONENT; - } else if (!tail.get(0).equals("")) { + } else if (!tail.get(0).isEmpty()) { // tail does not begin with "/" /* if (head.isEmpty()) { @@ -468,7 +468,7 @@ void checkAndAdjustRemainingName(Name rname) throws InvalidNameException { int count; if (rname != null && (count=rname.size()) > 1 && - rname.get(count-1).equals("")) { + rname.get(count-1).isEmpty()) { rname.remove(count-1); } } @@ -477,7 +477,7 @@ protected boolean isAllEmpty(Name n) { int count = n.size(); for (int i =0; i < count; i++ ) { - if (!n.get(i).equals("")) { + if (!n.get(i).isEmpty()) { return false; } } --- old/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java 2018-12-06 14:53:32.024018474 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java 2018-12-06 14:53:31.860017661 -0500 @@ -203,7 +203,7 @@ public void setErrorNNS(Object resObj, String remain) { CompositeName rname = new CompositeName(); try { - if (remain != null && !remain.equals("")) + if (remain != null && !remain.isEmpty()) rname.add(remain); rname.add(""); @@ -247,7 +247,7 @@ */ public void setError(Object resObj, String remain) { CompositeName rname = new CompositeName(); - if (remain != null && !remain.equals("")) { + if (remain != null && !remain.isEmpty()) { try { rname.add(remain); } catch (InvalidNameException e) { @@ -375,14 +375,14 @@ public void setContinue(Object obj, String relResName, Context currCtx, String remain) { CompositeName relname = new CompositeName(); - if (!relResName.equals("")) { + if (!relResName.isEmpty()) { try { relname.add(relResName); } catch (NamingException e){} } CompositeName rname = new CompositeName(); - if (!remain.equals("")) { + if (!remain.isEmpty()) { try { rname.add(remain); } catch (NamingException e) { --- old/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java 2018-12-06 14:53:32.792022282 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java 2018-12-06 14:53:32.624021449 -0500 @@ -477,9 +477,9 @@ int len = prefix.size(); if (!allEmpty(prefix) && !allEmpty(name)) { - if (res.get(len - 1).equals("")) { + if (res.get(len - 1).isEmpty()) { res.remove(len - 1); - } else if (res.get(len).equals("")) { + } else if (res.get(len).isEmpty()) { res.remove(len); } } --- old/src/java.naming/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java 2018-12-06 14:53:33.564026110 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java 2018-12-06 14:53:33.392025257 -0500 @@ -138,7 +138,7 @@ // if the name is relative, we need to add it to the name of this // context to keep it relative w.r.t. the root context we are // enumerating - if(oldBinding.isRelative() && !contextName.equals("")) { + if(oldBinding.isRelative() && !contextName.isEmpty()) { NameParser parser = root.getNameParser(""); Name newName = parser.parse(contextName); newName.add(oldBinding.getName()); --- old/src/java.naming/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java 2018-12-06 14:53:34.336029939 -0500 +++ new/src/java.naming/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java 2018-12-06 14:53:34.168029105 -0500 @@ -476,9 +476,9 @@ public String composeName(String name, String prefix) throws NamingException { - if (prefix.equals("")) { + if (prefix.isEmpty()) { return name; - } else if (name.equals("")) { + } else if (name.isEmpty()) { return prefix; } else { return (prefix + "/" + name); --- old/src/java.net.http/share/classes/jdk/internal/net/http/Http1Request.java 2018-12-06 14:53:35.096033707 -0500 +++ new/src/java.net.http/share/classes/jdk/internal/net/http/Http1Request.java 2018-12-06 14:53:34.924032854 -0500 @@ -201,13 +201,13 @@ private String getPathAndQuery(URI uri) { String path = uri.getRawPath(); String query = uri.getRawQuery(); - if (path == null || path.equals("")) { + if (path == null || path.isEmpty()) { path = "/"; } if (query == null) { query = ""; } - if (query.equals("")) { + if (query.isEmpty()) { return Utils.encode(path); } else { return Utils.encode(path + "?" + query); --- old/src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestBuilderImpl.java 2018-12-06 14:53:35.864037515 -0500 +++ new/src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestBuilderImpl.java 2018-12-06 14:53:35.696036682 -0500 @@ -190,7 +190,7 @@ @Override public HttpRequest.Builder method(String method, BodyPublisher body) { requireNonNull(method); - if (method.equals("")) + if (method.isEmpty()) throw newIAE("illegal method "); if (method.equals("CONNECT")) throw newIAE("method CONNECT is not supported"); @@ -205,7 +205,7 @@ private HttpRequest.Builder method0(String method, BodyPublisher body) { assert method != null; - assert !method.equals(""); + assert !method.isEmpty(); this.method = method; this.bodyPublisher = body; return this; --- old/src/java.net.http/share/classes/jdk/internal/net/http/ResponseContent.java 2018-12-06 14:53:36.620041264 -0500 +++ new/src/java.net.http/share/classes/jdk/internal/net/http/ResponseContent.java 2018-12-06 14:53:36.448040411 -0500 @@ -84,7 +84,7 @@ if (contentLength == -1) { String tc = headers.firstValue("Transfer-Encoding") .orElse(""); - if (!tc.equals("")) { + if (!tc.isEmpty()) { if (tc.equalsIgnoreCase("chunked")) { chunkedContent = true; } else { --- old/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java 2018-12-06 14:53:37.400045132 -0500 +++ new/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java 2018-12-06 14:53:37.224044259 -0500 @@ -97,7 +97,7 @@ private static final ByteBuffer NOTHING = ByteBuffer.allocate(0); private static final String monProp = Utils.getProperty("jdk.internal.httpclient.monitorFlowDelegate"); private static final boolean isMonitored = - monProp != null && (monProp.equals("") || monProp.equalsIgnoreCase("true")); + monProp != null && (monProp.isEmpty() || monProp.equalsIgnoreCase("true")); final Executor exec; final Reader reader; --- old/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java 2018-12-06 14:53:38.184049020 -0500 +++ new/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java 2018-12-06 14:53:38.016048187 -0500 @@ -203,7 +203,7 @@ */ protected AbstractPreferences(AbstractPreferences parent, String name) { if (parent==null) { - if (!name.equals("")) + if (!name.isEmpty()) throw new IllegalArgumentException("Root name '"+name+ "' must be \"\""); this.absolutePath = "/"; @@ -212,7 +212,7 @@ if (name.indexOf('/') != -1) throw new IllegalArgumentException("Name '" + name + "' contains '/'"); - if (name.equals("")) + if (name.isEmpty()) throw new IllegalArgumentException("Illegal name: empty string"); root = parent.root; @@ -848,7 +848,7 @@ synchronized(lock) { if (removed) throw new IllegalStateException("Node has been removed."); - if (path.equals("")) + if (path.isEmpty()) return this; if (path.equals("/")) return root; @@ -911,7 +911,7 @@ throws BackingStoreException { synchronized(lock) { - if (path.equals("")) + if (path.isEmpty()) return !removed; if (removed) throw new IllegalStateException("Node has been removed."); --- old/src/java.rmi/share/classes/com/sun/rmi/rmid/ExecOptionPermission.java 2018-12-06 14:53:38.972052927 -0500 +++ new/src/java.rmi/share/classes/com/sun/rmi/rmid/ExecOptionPermission.java 2018-12-06 14:53:38.808052114 -0500 @@ -189,7 +189,7 @@ if (name == null) throw new NullPointerException("name can't be null"); - if (name.equals("")) { + if (name.isEmpty()) { throw new IllegalArgumentException("name can't be empty"); } --- old/src/java.rmi/share/classes/java/rmi/Naming.java 2018-12-06 14:53:39.728056676 -0500 +++ new/src/java.rmi/share/classes/java/rmi/Naming.java 2018-12-06 14:53:39.564055863 -0500 @@ -199,7 +199,7 @@ Registry registry = getRegistry(parsed); String prefix = ""; - if (parsed.port > 0 || !parsed.host.equals("")) + if (parsed.port > 0 || !parsed.host.isEmpty()) prefix += "//" + parsed.host; if (parsed.port > 0) prefix += ":" + parsed.port; --- old/src/java.rmi/share/classes/sun/rmi/server/ActivatableRef.java 2018-12-06 14:53:40.480060405 -0500 +++ new/src/java.rmi/share/classes/sun/rmi/server/ActivatableRef.java 2018-12-06 14:53:40.308059552 -0500 @@ -370,7 +370,7 @@ ref = null; String className = in.readUTF(); - if (className.equals("")) return; + if (className.isEmpty()) return; try { Class refClass = Class.forName(RemoteRef.packagePrefix + "." + --- old/src/java.rmi/share/classes/sun/rmi/server/Activation.java 2018-12-06 14:53:41.264064293 -0500 +++ new/src/java.rmi/share/classes/sun/rmi/server/Activation.java 2018-12-06 14:53:41.088063420 -0500 @@ -1857,7 +1857,7 @@ checkPermission(perms, new ExecOptionPermission(option)); } catch (AccessControlException e) { - if (value.equals("")) { + if (value.isEmpty()) { checkPermission(perms, new ExecOptionPermission("-D" + name)); } else { @@ -2101,7 +2101,7 @@ * Initialize method for activation exec policy. */ if (!execPolicyClassName.equals("none")) { - if (execPolicyClassName.equals("") || + if (execPolicyClassName.isEmpty() || execPolicyClassName.equals("default")) { execPolicyClassName = DefaultExecPolicy.class.getName(); --- old/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java 2018-12-06 14:53:42.064068260 -0500 +++ new/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java 2018-12-06 14:53:41.892067407 -0500 @@ -738,7 +738,7 @@ } hostName = f.getHost(); - if ((hostName == null) || (hostName.equals("")) + if ((hostName == null) || (hostName.isEmpty()) || (hostName.indexOf('.') < 0 )) { hostName = hostAddress; --- old/src/java.scripting/share/classes/com/sun/tools/script/shell/Main.java 2018-12-06 14:53:42.844072128 -0500 +++ new/src/java.scripting/share/classes/com/sun/tools/script/shell/Main.java 2018-12-06 14:53:42.672071275 -0500 @@ -114,7 +114,7 @@ System.setProperty(value.substring(0, eq), value.substring(eq + 1)); } else { - if (!value.equals("")) { + if (!value.isEmpty()) { System.setProperty(value, ""); } else { // do not allow empty property name --- old/src/java.sql.rowset/share/classes/com/sun/rowset/CachedRowSetImpl.java 2018-12-06 14:53:43.616075956 -0500 +++ new/src/java.sql.rowset/share/classes/com/sun/rowset/CachedRowSetImpl.java 2018-12-06 14:53:43.440075083 -0500 @@ -593,7 +593,7 @@ super.setCommand(cmd); - if(!buildTableName(cmd).equals("")) { + if(!buildTableName(cmd).isEmpty()) { this.setTableName(buildTableName(cmd)); } } @@ -7069,7 +7069,7 @@ public void setMatchColumn(String[] columnNames) throws SQLException { for(int j = 0; j < columnNames.length; j++) { - if( columnNames[j] == null || columnNames[j].equals("")) { + if( columnNames[j] == null || columnNames[j].isEmpty()) { throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols2").toString()); } } @@ -7124,7 +7124,7 @@ */ public void setMatchColumn(String columnName) throws SQLException { // validate, if col is ok to be set - if(columnName == null || (columnName= columnName.trim()).equals("") ) { + if(columnName == null || (columnName= columnName.trim()).isEmpty() ) { throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols2").toString()); } else { // set strMatchColumn --- old/src/java.sql.rowset/share/classes/com/sun/rowset/JdbcRowSetImpl.java 2018-12-06 14:53:44.460080141 -0500 +++ new/src/java.sql.rowset/share/classes/com/sun/rowset/JdbcRowSetImpl.java 2018-12-06 14:53:44.292079308 -0500 @@ -624,7 +624,7 @@ (getDataSourceName()); //return ds.getConnection(getUsername(),getPassword()); - if(getUsername() != null && !getUsername().equals("")) { + if(getUsername() != null && !getUsername().isEmpty()) { return ds.getConnection(getUsername(),getPassword()); } else { return ds.getConnection(); @@ -3873,7 +3873,7 @@ public void setMatchColumn(String[] columnNames) throws SQLException { for(int j = 0; j < columnNames.length; j++) { - if( columnNames[j] == null || columnNames[j].equals("")) { + if( columnNames[j] == null || columnNames[j].isEmpty()) { throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.matchcols2").toString()); } } @@ -3928,7 +3928,7 @@ */ public void setMatchColumn(String columnName) throws SQLException { // validate, if col is ok to be set - if(columnName == null || (columnName= columnName.trim()).equals("")) { + if(columnName == null || (columnName= columnName.trim()).isEmpty()) { throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.matchcols2").toString()); } else { // set strMatchColumn --- old/src/java.sql.rowset/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java 2018-12-06 14:53:45.228083949 -0500 +++ new/src/java.sql.rowset/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java 2018-12-06 14:53:45.060083116 -0500 @@ -537,7 +537,7 @@ private void writeStringData(String s) throws java.io.IOException { if (s == null) { writeNull(); - } else if (s.equals("")) { + } else if (s.isEmpty()) { writeEmptyString(); } else { --- old/src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java 2018-12-06 14:53:45.980087678 -0500 +++ new/src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java 2018-12-06 14:53:45.804086806 -0500 @@ -852,7 +852,7 @@ if (name == null) { dataSource = null; - } else if (name.equals("")) { + } else if (name.isEmpty()) { throw new SQLException("DataSource name cannot be empty string"); } else { dataSource = name; --- old/src/java.sql/share/classes/java/sql/DriverManager.java 2018-12-06 14:53:46.784091665 -0500 +++ new/src/java.sql/share/classes/java/sql/DriverManager.java 2018-12-06 14:53:46.612090812 -0500 @@ -622,7 +622,7 @@ println("DriverManager.initialize: jdbc.drivers = " + drivers); - if (drivers != null && !drivers.equals("")) { + if (drivers != null && !drivers.isEmpty()) { String[] driversList = drivers.split(":"); println("number of Drivers:" + driversList.length); for (String aDriver : driversList) { --- old/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java 2018-12-06 14:53:47.572095573 -0500 +++ new/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java 2018-12-06 14:53:47.400094720 -0500 @@ -446,14 +446,14 @@ private boolean getSystemProperty(Limit limit, String sysPropertyName) { try { String value = SecuritySupport.getSystemProperty(sysPropertyName); - if (value != null && !value.equals("")) { + if (value != null && !value.isEmpty()) { values[limit.ordinal()] = Integer.parseInt(value); states[limit.ordinal()] = State.SYSTEMPROPERTY; return true; } value = SecuritySupport.readJAXPProperty(sysPropertyName); - if (value != null && !value.equals("")) { + if (value != null && !value.isEmpty()) { values[limit.ordinal()] = Integer.parseInt(value); states[limit.ordinal()] = State.JAXPDOTPROPERTIES; return true; --- old/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java 2018-12-06 14:53:48.324099302 -0500 +++ new/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java 2018-12-06 14:53:48.160098488 -0500 @@ -460,7 +460,7 @@ if (name != null) { setClassName(name); } - else if (systemId != null && !systemId.equals("")) { + else if (systemId != null && !systemId.isEmpty()) { setClassName(Util.baseName(systemId)); } @@ -770,7 +770,7 @@ _attributes.put(name.toString(), code); final String uri = name.getNamespace(); final String local = "@"+name.getLocalPart(); - if ((uri != null) && (!uri.equals(""))) + if ((uri != null) && (!uri.isEmpty())) _namesIndex.add(uri+":"+local); else _namesIndex.add(local); @@ -810,7 +810,7 @@ code = _nextGType++; _namespacePrefixes.put(name.toString(), code); final String uri = name.getNamespace(); - if ((uri != null) && (!uri.equals(""))){ + if ((uri != null) && (!uri.isEmpty())){ // namespace::ext2:ped2 will be made empty in TypedNamespaceIterator _namesIndex.add("?"); } else{ --- old/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java 2018-12-06 14:53:49.092103110 -0500 +++ new/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java 2018-12-06 14:53:48.928102297 -0500 @@ -256,7 +256,7 @@ CachedDocument doc; String uri = href; - if (baseURI != null && !baseURI.equals("")) { + if (baseURI != null && !baseURI.isEmpty()) { try { uri = SystemIDResolver.getAbsoluteURI(uri, baseURI); } catch (TransformerException te) { --- old/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/LoadDocument.java 2018-12-06 14:53:49.864106938 -0500 +++ new/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/LoadDocument.java 2018-12-06 14:53:49.688106065 -0500 @@ -159,13 +159,13 @@ MultiDOM multiplexer = (MultiDOM)dom; // Prepend URI base to URI (from context) - if (base != null && !base.equals("")) { + if (base != null && !base.isEmpty()) { uri = SystemIDResolver.getAbsoluteURI(uri, base); } // Return an empty iterator if the URI is clearly invalid // (to prevent some unncessary MalformedURL exceptions). - if (uri == null || uri.equals("")) { + if (uri == null || uri.isEmpty()) { return(EmptyIterator.getInstance()); } --- old/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java 2018-12-06 14:53:50.644110806 -0500 +++ new/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java 2018-12-06 14:53:50.464109913 -0500 @@ -197,7 +197,7 @@ String attURI = attrs.getURI(i); String type = (attrs.getType(i) == null) ? XMLSymbols.fCDATASymbol : attrs.getType(i); - if (attrs.getLocalName(i).equals("")) { + if (attrs.getLocalName(i).isEmpty()) { tmp.setAttribute(attQName, attrs.getValue(i)); if (type.equals("ID")) { tmp.setIdAttribute(attQName, true); --- old/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java 2018-12-06 14:53:51.388114495 -0500 +++ new/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java 2018-12-06 14:53:51.212113622 -0500 @@ -542,7 +542,7 @@ { // We can't dispatch to blank type-name, and of course we need // a listener to dispatch to - if (type == null || type.equals("") || listener == null) + if (type == null || type.isEmpty() || listener == null) return; // Each listener may be registered only once per type per phase. @@ -586,7 +586,7 @@ boolean useCapture) { // If this couldn't be a valid listener registration, ignore request - if (type == null || type.equals("") || listener == null) + if (type == null || type.isEmpty() || listener == null) return; List nodeListeners = getEventListeners(node); if (nodeListeners == null) @@ -690,7 +690,7 @@ // VALIDATE -- must have been initialized at least once, must have // a non-null non-blank name. - if(!evt.initialized || evt.type == null || evt.type.equals("")) { + if(!evt.initialized || evt.type == null || evt.type.isEmpty()) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "UNSPECIFIED_EVENT_TYPE_ERR", null); throw new EventException(EventException.UNSPECIFIED_EVENT_TYPE_ERR, msg); } --- old/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java 2018-12-06 14:53:52.176118403 -0500 +++ new/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java 2018-12-06 14:53:52.012117589 -0500 @@ -1051,7 +1051,7 @@ || fEventType == XMLEvent.NAMESPACE) { //namespaceContext is dynamic object. String prefix = fScanner.getNamespaceContext().getDeclaredPrefixAt(index); - return prefix.equals("") ? null : prefix; + return prefix.isEmpty() ? null : prefix; } else { throw new IllegalStateException("Current state " + getEventTypeString(fEventType) + " is not among the states " + getEventTypeString(XMLEvent.START_ELEMENT) --- old/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java 2018-12-06 14:53:52.944122211 -0500 +++ new/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java 2018-12-06 14:53:52.772121358 -0500 @@ -2318,7 +2318,7 @@ } public String getType(String uri, String localName) { - return uri.equals("") ? fAttributes.getType(null, localName) : + return uri.isEmpty() ? fAttributes.getType(null, localName) : fAttributes.getType(uri, localName); } @@ -2331,7 +2331,7 @@ } public String getValue(String uri, String localName) { - return uri.equals("") ? fAttributes.getValue(null, localName) : + return uri.isEmpty() ? fAttributes.getValue(null, localName) : fAttributes.getValue(uri, localName); } @@ -2340,7 +2340,7 @@ } public int getIndex(String uri, String localPart) { - return uri.equals("") ? fAttributes.getIndex(null, localPart) : + return uri.isEmpty() ? fAttributes.getIndex(null, localPart) : fAttributes.getIndex(uri, localPart); } --- old/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/SecurityManager.java 2018-12-06 14:53:53.716126039 -0500 +++ new/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/util/SecurityManager.java 2018-12-06 14:53:53.552125226 -0500 @@ -138,7 +138,7 @@ try { String value = System.getProperty(Constants.ENTITY_EXPANSION_LIMIT); - if(value != null && !value.equals("")){ + if(value != null && !value.isEmpty()){ entityExpansionLimit = Integer.parseInt(value); if (entityExpansionLimit < 0) entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; @@ -149,7 +149,7 @@ try { String value = System.getProperty(Constants.MAX_OCCUR_LIMIT); - if(value != null && !value.equals("")){ + if(value != null && !value.isEmpty()){ maxOccurLimit = Integer.parseInt(value); if (maxOccurLimit < 0) maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; @@ -160,7 +160,7 @@ try { String value = System.getProperty(Constants.ELEMENT_ATTRIBUTE_LIMIT); - if(value != null && !value.equals("")){ + if(value != null && !value.isEmpty()){ fElementAttributeLimit = Integer.parseInt(value); if ( fElementAttributeLimit < 0) fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; --- old/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java 2018-12-06 14:53:54.456129709 -0500 +++ new/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java 2018-12-06 14:53:54.288128876 -0500 @@ -528,14 +528,14 @@ private boolean getSystemProperty(Limit limit, String sysPropertyName) { try { String value = SecuritySupport.getSystemProperty(sysPropertyName); - if (value != null && !value.equals("")) { + if (value != null && !value.isEmpty()) { values[limit.ordinal()] = Integer.parseInt(value); states[limit.ordinal()] = State.SYSTEMPROPERTY; return true; } value = SecuritySupport.readJAXPProperty(sysPropertyName); - if (value != null && !value.equals("")) { + if (value != null && !value.isEmpty()) { values[limit.ordinal()] = Integer.parseInt(value); states[limit.ordinal()] = State.JAXPDOTPROPERTIES; return true; --- old/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/ExpandedNameTable.java 2018-12-06 14:53:55.212133458 -0500 +++ new/src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/ExpandedNameTable.java 2018-12-06 14:53:55.044132624 -0500 @@ -301,7 +301,7 @@ public final int getLocalNameID(int ExpandedNameID) { // ExtendedType etype = m_extendedTypes[ExpandedNameID]; - if (m_extendedTypes[ExpandedNameID].getLocalName().equals("")) + if (m_extendedTypes[ExpandedNameID].getLocalName().isEmpty()) return 0; else return ExpandedNameID; @@ -318,7 +318,7 @@ public String getNamespace(int ExpandedNameID) { String namespace = m_extendedTypes[ExpandedNameID].getNamespace(); - return (namespace.equals("") ? null : namespace); + return (namespace.isEmpty() ? null : namespace); } /** @@ -330,7 +330,7 @@ public final int getNamespaceID(int ExpandedNameID) { //ExtendedType etype = m_extendedTypes[ExpandedNameID]; - if (m_extendedTypes[ExpandedNameID].getNamespace().equals("")) + if (m_extendedTypes[ExpandedNameID].getNamespace().isEmpty()) return 0; else return ExpandedNameID; --- old/src/java.xml/share/classes/com/sun/xml/internal/stream/events/AttributeImpl.java 2018-12-06 14:53:55.964137186 -0500 +++ new/src/java.xml/share/classes/com/sun/xml/internal/stream/events/AttributeImpl.java 2018-12-06 14:53:55.800136373 -0500 @@ -85,7 +85,7 @@ init(); fQName = qname ; fValue = value ; - if(type != null && !type.equals("")) + if(type != null && !type.isEmpty()) fAttributeType = type; fNonNormalizedvalue = nonNormalizedvalue; --- old/src/java.xml/share/classes/com/sun/xml/internal/stream/events/StartDocumentEvent.java 2018-12-06 14:53:56.708140876 -0500 +++ new/src/java.xml/share/classes/com/sun/xml/internal/stream/events/StartDocumentEvent.java 2018-12-06 14:53:56.536140023 -0500 @@ -73,7 +73,7 @@ this.fEncodingScheam = encoding; this.fVersion = version; this.fStandalone = standalone; - if (encoding != null && !encoding.equals("")) + if (encoding != null && !encoding.isEmpty()) this.fEncodingSchemeSet = true; else { this.fEncodingSchemeSet = false; --- old/src/java.xml/share/classes/com/sun/xml/internal/stream/writers/XMLDOMWriterImpl.java 2018-12-06 14:53:57.472144664 -0500 +++ new/src/java.xml/share/classes/com/sun/xml/internal/stream/writers/XMLDOMWriterImpl.java 2018-12-06 14:53:57.300143811 -0500 @@ -219,7 +219,7 @@ } String qualifiedName = null; - if(prefix.equals("")){ + if(prefix.isEmpty()){ qualifiedName = localName; }else{ qualifiedName = getQName(prefix,localName); @@ -254,7 +254,7 @@ throw new XMLStreamException("prefix cannot be null"); } String qualifiedName = null; - if(prefix.equals("")){ + if(prefix.isEmpty()){ qualifiedName = localName; }else{ @@ -502,7 +502,7 @@ String qname = null; - if (prefix.equals("")) { + if (prefix.isEmpty()) { qname = XMLConstants.XMLNS_ATTRIBUTE; } else { qname = getQName(XMLConstants.XMLNS_ATTRIBUTE,prefix); @@ -669,7 +669,7 @@ throw new XMLStreamException("Prefix cannot be null"); } - if(prefix.equals("")){ + if(prefix.isEmpty()){ qname = localName; }else{ qname = getQName(prefix,localName); --- old/src/java.xml/share/classes/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java 2018-12-06 14:53:58.216148354 -0500 +++ new/src/java.xml/share/classes/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java 2018-12-06 14:53:58.052147540 -0500 @@ -628,8 +628,8 @@ } if (!fIsRepairingNamespace) { - if (prefix == null || prefix.equals("")){ - if (!namespaceURI.equals("")) { + if (prefix == null || prefix.isEmpty()){ + if (!namespaceURI.isEmpty()) { throw new XMLStreamException("prefix cannot be null or empty"); } else { writeAttributeWithPrefix(null, localName, value); @@ -908,7 +908,7 @@ } else { fWriter.write(OPEN_END_TAG); - if ((elem.prefix != null) && !(elem.prefix).equals("")) { + if ((elem.prefix != null) && !(elem.prefix).isEmpty()) { fWriter.write(elem.prefix); fWriter.write(":"); } @@ -945,7 +945,7 @@ fWriter.write(OPEN_END_TAG); if ((currentElement.prefix != null) && - !(currentElement.prefix).equals("")) { + !(currentElement.prefix).isEmpty()) { fWriter.write(currentElement.prefix); fWriter.write(":"); } @@ -1180,19 +1180,19 @@ } // Verify the encoding before writing anything - if (encoding != null && !encoding.equals("")) { + if (encoding != null && !encoding.isEmpty()) { verifyEncoding(encoding); } fWriter.write("