diff options
author | Ivan Frade <ifrade@google.com> | 2024-11-13 16:11:17 -0800 |
---|---|---|
committer | Ivan Frade <ifrade@google.com> | 2024-11-13 16:11:17 -0800 |
commit | 13a1ce7466eb620773930f1d485cb9b31c6bda2c (patch) | |
tree | bd8fbbc2d90228f251ea21f7448a9a9c94fad50f | |
parent | 1c326c4e07b1023ef17961661ed6e4f29ffeeee8 (diff) | |
download | jgit-13a1ce7466eb620773930f1d485cb9b31c6bda2c.tar.gz jgit-13a1ce7466eb620773930f1d485cb9b31c6bda2c.zip |
[errorprone] RawText: Add parenthesis for explicit op precedence
errorprone reports:
[OperatorPrecedence] Use grouping parenthesis to make the
operator precedence explicit
Take the chance to fix also
https://errorprone.info/bugpattern/YodaCondition in the same lines.
Change-Id: I6d8f00842ef2bb24cd00fc413121b8a4e20c186b
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java index 5a4d2aa45a..fdfe533618 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java @@ -365,7 +365,7 @@ public class RawText extends Sequence { byte current; while (ptr < length - 2) { current = raw[++ptr]; - if ('\0' == current || '\r' == current && raw[++ptr] != '\n') { + if (current == '\0' || (current == '\r' && raw[++ptr] != '\n')) { return true; } } @@ -373,7 +373,7 @@ public class RawText extends Sequence { if (ptr == length - 2) { // if '\r' be last, then if isComplete then return binary current = raw[++ptr]; - return '\0' == current || '\r' == current && isComplete; + return current == '\0' || (current == '\r' && isComplete); } return false; @@ -490,7 +490,7 @@ public class RawText extends Sequence { if (ptr == length - 2) { // if '\r' be last, then if isComplete then return binary current = raw[++ptr]; - if('\0' == current || '\r' == current && complete){ + if (current == '\0' || (current == '\r' && complete)) { return false; } } |