Use String#isEmpty()

This commit is contained in:
Michael Osipov 2019-12-15 11:49:26 +01:00
parent 8be681964c
commit ebccd5d225
2 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ class CachedResponseSuitabilityChecker {
while (it.hasNext()) {
final HeaderElement elt = it.next();
if (HeaderConstants.CACHE_CONTROL_MAX_STALE.equals(elt.getName())) {
if ((elt.getValue() == null || "".equals(elt.getValue().trim())) && maxStale == -1) {
if ((elt.getValue() == null || elt.getValue().trim().isEmpty()) && maxStale == -1) {
maxStale = Long.MAX_VALUE;
} else {
try {

View File

@ -138,7 +138,7 @@ class ResponseProtocolCompliance {
}
}
final String newHeaderValue = buf.toString();
if (!"".equals(newHeaderValue)) {
if (!newHeaderValue.isEmpty()) {
newHeaders.add(new BasicHeader(HttpHeaders.CONTENT_ENCODING, newHeaderValue));
}
}