< prev index next >

src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD

@@ -64,11 +64,11 @@
     private volatile Resource resource;
 
     JavaRuntimeURLConnection(URL url) throws IOException {
         super(url);
         String path = url.getPath();
-        if (path.length() == 0 || path.charAt(0) != '/')
+        if (path.isEmpty() || path.charAt(0) != '/')
             throw new MalformedURLException(url + " missing path or /");
         if (path.length() == 1) {
             this.module = null;
             this.name = null;
         } else {
< prev index next >