Fix all remaining instances of the OperatorPrededence warning, by adding parentheses to make the precedence explicit. Change-Id: Ib296dfed09f9be042d0ff0f7fad8214e4dd766b4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>tags/v5.4.0.201906121030-r
public final boolean matches(String path, boolean assumeDirectory, | public final boolean matches(String path, boolean assumeDirectory, | ||||
boolean pathMatch) { | boolean pathMatch) { | ||||
return !dirOnly || assumeDirectory | return !dirOnly || assumeDirectory | ||||
|| !pathMatch && isSubdirectory(path); | |||||
|| (!pathMatch && isSubdirectory(path)); | |||||
} | } | ||||
/** {@inheritDoc} */ | /** {@inheritDoc} */ |
final byte[] buf = buffer(); | final byte[] buf = buffer(); | ||||
int sz = data.length; | int sz = data.length; | ||||
int len = 0; | int len = 0; | ||||
buf[len++] = (byte) ((typeCode << 4) | sz & 15); | |||||
buf[len++] = (byte) ((typeCode << 4) | (sz & 15)); | |||||
sz >>>= 4; | sz >>>= 4; | ||||
while (sz > 0) { | while (sz > 0) { | ||||
buf[len - 1] |= 0x80; | buf[len - 1] |= 0x80; |
final byte[] buf = buffer(); | final byte[] buf = buffer(); | ||||
int sz = data.length; | int sz = data.length; | ||||
int len = 0; | int len = 0; | ||||
buf[len++] = (byte) ((typeCode << 4) | sz & 15); | |||||
buf[len++] = (byte) ((typeCode << 4) | (sz & 15)); | |||||
sz >>>= 4; | sz >>>= 4; | ||||
while (sz > 0) { | while (sz > 0) { | ||||
buf[len - 1] |= 0x80; | buf[len - 1] |= 0x80; |
* can always correctly determine the buffer format. | * can always correctly determine the buffer format. | ||||
*/ | */ | ||||
final int fb = hdr[0] & 0xff; | final int fb = hdr[0] & 0xff; | ||||
return (fb & 0x8f) == 0x08 && (((fb << 8) | hdr[1] & 0xff) % 31) == 0; | |||||
return (fb & 0x8f) == 0x08 && (((fb << 8) | (hdr[1] & 0xff)) % 31) == 0; | |||||
} | } | ||||
static InputStream inflate(final InputStream in, final long size, | static InputStream inflate(final InputStream in, final long size, |
state.writeTo(out, null); | state.writeTo(out, null); | ||||
} | } | ||||
if (receivedContinue && havesSinceLastContinue > MAX_HAVES | |||||
if ((receivedContinue && havesSinceLastContinue > MAX_HAVES) | |||||
|| havesSent >= maxHaves) { | || havesSent >= maxHaves) { | ||||
// Our history must be really different from the remote's. | // Our history must be really different from the remote's. | ||||
// We just sent a whole slew of have lines, and it did not | // We just sent a whole slew of have lines, and it did not |
// A longer path match is always preferred even over a user | // A longer path match is always preferred even over a user | ||||
// match. If the path matches are equal, a match with user wins | // match. If the path matches are equal, a match with user wins | ||||
// over a match without user. | // over a match without user. | ||||
if (matchLength > bestMatchLength || !withUser && hasUser | |||||
&& matchLength >= 0 && matchLength == bestMatchLength) { | |||||
if (matchLength > bestMatchLength | |||||
|| (!withUser && hasUser && matchLength >= 0 | |||||
&& matchLength == bestMatchLength)) { | |||||
bestMatch = s; | bestMatch = s; | ||||
bestMatchLength = matchLength; | bestMatchLength = matchLength; | ||||
withUser = hasUser; | withUser = hasUser; | ||||
int uLength = uriPath.length(); | int uLength = uriPath.length(); | ||||
int mLength = matchPath.length(); | int mLength = matchPath.length(); | ||||
if (mLength == uLength || matchPath.charAt(mLength - 1) == '/' | if (mLength == uLength || matchPath.charAt(mLength - 1) == '/' | ||||
|| mLength < uLength && uriPath.charAt(mLength) == '/') { | |||||
|| (mLength < uLength && uriPath.charAt(mLength) == '/')) { | |||||
return mLength; | return mLength; | ||||
} | } | ||||
return -1; | return -1; | ||||
if (slash < 0) { | if (slash < 0) { | ||||
slash = length; | slash = length; | ||||
} | } | ||||
if (slash == i || slash == i + 1 && path.charAt(i) == '.') { | |||||
if (slash == i || (slash == i + 1 && path.charAt(i) == '.')) { | |||||
// Skip /. or also double slashes | // Skip /. or also double slashes | ||||
} else if (slash == i + 2 && path.charAt(i) == '.' | } else if (slash == i + 2 && path.charAt(i) == '.' | ||||
&& path.charAt(i + 1) == '.') { | && path.charAt(i + 1) == '.') { |
if (p.length() >= 3 | if (p.length() >= 3 | ||||
&& p.charAt(0) == '/' | && p.charAt(0) == '/' | ||||
&& p.charAt(2) == ':' | && p.charAt(2) == ':' | ||||
&& (p.charAt(1) >= 'A' && p.charAt(1) <= 'Z' || p.charAt(1) >= 'a' | |||||
&& p.charAt(1) <= 'z')) | |||||
&& ((p.charAt(1) >= 'A' && p.charAt(1) <= 'Z') | |||||
|| (p.charAt(1) >= 'a' && p.charAt(1) <= 'z'))) | |||||
return p.substring(1); | return p.substring(1); | ||||
else if (s != null && p.length() >= 2 && p.charAt(0) == '/' | else if (s != null && p.length() >= 2 && p.charAt(0) == '/' | ||||
&& p.charAt(1) == '~') | && p.charAt(1) == '~') |
"-Xep:NullableConstructor:ERROR", | "-Xep:NullableConstructor:ERROR", | ||||
"-Xep:NullablePrimitive:ERROR", | "-Xep:NullablePrimitive:ERROR", | ||||
"-Xep:NullableVoid:ERROR", | "-Xep:NullableVoid:ERROR", | ||||
"-Xep:OperatorPrecedence:WARN", | |||||
"-Xep:OperatorPrecedence:ERROR", | |||||
"-Xep:OverridesGuiceInjectableMethod:ERROR", | "-Xep:OverridesGuiceInjectableMethod:ERROR", | ||||
"-Xep:PreconditionsInvalidPlaceholder:ERROR", | "-Xep:PreconditionsInvalidPlaceholder:ERROR", | ||||
"-Xep:ProtoFieldPreconditionsCheckNotNull:ERROR", | "-Xep:ProtoFieldPreconditionsCheckNotNull:ERROR", |