Browse Source

TransportHttp: Check for non-empty list with "!isEmpty()" rather than "size() > 0"

Change-Id: Iabb627c8f584346eb8ace3c24afb63b4d1ad3d47
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.5
David Pursehouse 6 years ago
parent
commit
b5a1b770a0
  1. 4
      org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java

4
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java

@ -641,7 +641,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
foundCookies.addAll(
extractCookies(HDR_SET_COOKIE2, cookieHeaderValues));
}
if (foundCookies.size() > 0) {
if (!foundCookies.isEmpty()) {
try {
// update cookie lists with the newly received cookies!
Set<HttpCookie> cookies = cookieFile.getCookies(false);
@ -929,7 +929,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
conn.setReadTimeout(effTimeOut);
}
// set cookie header if necessary
if (relevantCookies.size() > 0) {
if (!relevantCookies.isEmpty()) {
setCookieHeader(conn);
}

Loading…
Cancel
Save