From: David Pursehouse Date: Wed, 12 Jun 2019 04:12:52 +0000 (+0900) Subject: BasePackFetchConnection: Prefer boolean operators over logical operators in comparisons X-Git-Tag: v5.4.1.201908211225-r~38 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2eeabde94a4a39dd827d4ecc8110a6137d401cba;p=jgit.git BasePackFetchConnection: Prefer boolean operators over logical operators in comparisons 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 --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java index a61c243bdf..57d6bc2466 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java @@ -670,7 +670,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection } } - if (noDone & receivedReady) { + if (noDone && receivedReady) { break SEND_HAVES; } if (statelessRPC) {