Commit 44f6dbb0 by eguven Committed by Oliver Woodman

Work around the error prone warning

Error prone check doesn't like we pass a variable named 'end' as start parameter and 'start' as end.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159567308
parent 467fd253
...@@ -977,15 +977,15 @@ public final class Util { ...@@ -977,15 +977,15 @@ public final class Util {
int expectedLength = length - percentCharacterCount * 2; int expectedLength = length - percentCharacterCount * 2;
StringBuilder builder = new StringBuilder(expectedLength); StringBuilder builder = new StringBuilder(expectedLength);
Matcher matcher = ESCAPED_CHARACTER_PATTERN.matcher(fileName); Matcher matcher = ESCAPED_CHARACTER_PATTERN.matcher(fileName);
int endOfLastMatch = 0; int startOfNotEscaped = 0;
while (percentCharacterCount > 0 && matcher.find()) { while (percentCharacterCount > 0 && matcher.find()) {
char unescapedCharacter = (char) Integer.parseInt(matcher.group(1), 16); char unescapedCharacter = (char) Integer.parseInt(matcher.group(1), 16);
builder.append(fileName, endOfLastMatch, matcher.start()).append(unescapedCharacter); builder.append(fileName, startOfNotEscaped, matcher.start()).append(unescapedCharacter);
endOfLastMatch = matcher.end(); startOfNotEscaped = matcher.end();
percentCharacterCount--; percentCharacterCount--;
} }
if (endOfLastMatch < length) { if (startOfNotEscaped < length) {
builder.append(fileName, endOfLastMatch, length); builder.append(fileName, startOfNotEscaped, length);
} }
if (builder.length() != expectedLength) { if (builder.length() != expectedLength) {
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment