< prev index next >

src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()

*** 287,297 **** if (prt == null || !(prt.equals("rmi"))) { final String msg = "Invalid protocol type: " + prt; throw new MalformedURLException(msg); } final String urlPath = url.getURLPath(); ! if (!urlPath.equals("") && !urlPath.equals("/") && !urlPath.startsWith("/jndi/")) { final String msg = "URL path must be empty or start with " + "/jndi/"; throw new MalformedURLException(msg); --- 287,297 ---- if (prt == null || !(prt.equals("rmi"))) { final String msg = "Invalid protocol type: " + prt; throw new MalformedURLException(msg); } final String urlPath = url.getURLPath(); ! if (!urlPath.isEmpty() && !urlPath.equals("/") && !urlPath.startsWith("/jndi/")) { final String msg = "URL path must be empty or start with " + "/jndi/"; throw new MalformedURLException(msg);
*** 744,754 **** protocol = "rmi"; host = null; // will default to local host name port = 0; } else { protocol = address.getProtocol(); ! host = (address.getHost().equals("")) ? null : address.getHost(); port = address.getPort(); } final String urlPath = encodeStub(rmiServer, attributes); --- 744,754 ---- protocol = "rmi"; host = null; // will default to local host name port = 0; } else { protocol = address.getProtocol(); ! host = (address.getHost().isEmpty()) ? null : address.getHost(); port = address.getPort(); } final String urlPath = encodeStub(rmiServer, attributes);
< prev index next >