]> source.dussan.org Git - jgit.git/commitdiff
TransportHttp: Fix comparison of size with ">= 0" 80/143480/1
authorDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 7 Jun 2019 01:57:15 +0000 (10:57 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 7 Jun 2019 01:57:15 +0000 (10:57 +0900)
Error Prone reports:

  [SizeGreaterThanOrEqualsZero] Comparison of a size >= 0 is always true,
  did you intend to check for non-emptiness?

  see https://errorprone.info/bugpattern/SizeGreaterThanOrEqualsZero

Change-Id: Ie964771cacca4b15569eb45f6e273ad2a7e2e49c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java

index f44a99b8b411bf4e5b0a6222715fb59652de48ea..88349a7ee55be5290b08f9cf67b43a1ddcb4eb88 100644 (file)
@@ -952,7 +952,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
                                cookieHeaderValue.append(cookie.toString());
                        }
                }
-               if (cookieHeaderValue.length() >= 0) {
+               if (cookieHeaderValue.length() > 0) {
                        conn.setRequestProperty(HDR_COOKIE, cookieHeaderValue.toString());
                }
        }