]> source.dussan.org Git - jgit.git/commitdiff
BasePackFetchConnection: Prefer boolean operators over logical operators in comparisons 87/143787/3
authorDavid Pursehouse <david.pursehouse@gmail.com>
Wed, 12 Jun 2019 04:12:52 +0000 (13:12 +0900)
committerMatthias Sohn <matthias.sohn@sap.com>
Sat, 15 Jun 2019 19:55:39 +0000 (21:55 +0200)
Using the | and & operators in boolean conditions results in a warning
from Error Prone:

  [ShortCircuitBoolean]
  Prefer the short-circuiting boolean operators && and || to & and |.
  see https://errorprone.info/bugpattern/ShortCircuitBoolean

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

index a61c243bdf326031258df366aa29d3148d8bacab..57d6bc2466e957412956adfaad63036e2df81d89 100644 (file)
@@ -670,7 +670,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection
                                }
                        }
 
-                       if (noDone & receivedReady) {
+                       if (noDone && receivedReady) {
                                break SEND_HAVES;
                        }
                        if (statelessRPC) {