< 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,215 ****
}
private String getPathAndQuery(URI uri) {
String path = uri.getRawPath();
String query = uri.getRawQuery();
! if (path == null || path.equals("")) {
path = "/";
}
if (query == null) {
query = "";
}
! if (query.equals("")) {
return Utils.encode(path);
} else {
return Utils.encode(path + "?" + query);
}
}
--- 199,215 ----
}
private String getPathAndQuery(URI uri) {
String path = uri.getRawPath();
String query = uri.getRawQuery();
! if (path == null || path.isEmpty()) {
path = "/";
}
if (query == null) {
query = "";
}
! if (query.isEmpty()) {
return Utils.encode(path);
} else {
return Utils.encode(path + "?" + query);
}
}
< prev index next >