Browse Source

ObjectWalk: 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: I182f986263b8b9ac189907f4bd1662b4092a52d8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.4
David Pursehouse 6 years ago committed by Matthias Sohn
parent
commit
0f9063941c
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java

2
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java

@ -497,7 +497,7 @@ public class ObjectWalk extends RevWalk {
continue; continue;
} }
visitationPolicy.visited(o); visitationPolicy.visited(o);
if ((o.flags & UNINTERESTING) == 0 | boundary) { if ((o.flags & UNINTERESTING) == 0 || boundary) {
if (o instanceof RevTree) { if (o instanceof RevTree) {
// The previous while loop should have exhausted the stack // The previous while loop should have exhausted the stack
// of trees. // of trees.

Loading…
Cancel
Save