< prev index next >

src/java.net.http/share/classes/jdk/internal/net/http/Http1Request.java

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad

@@ -199,17 +199,17 @@
     }
 
     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);
         }
     }
< prev index next >