Extract increment operations to separate expressions. #1538
While increment or decrement expressions nested inside other expressions are admirably terse, such expressions may be confusing, and violate the general design principle that a given construct should do precisely one thing.
This commit is contained in:
parent
85ba2a3dce
commit
d49eaaf2e4
|
|
@ -252,7 +252,8 @@ public final class FileText extends AbstractList<String> {
|
|||
int lineNo = 1;
|
||||
final Matcher matcher = LINE_TERMINATOR.matcher(fullText);
|
||||
while (matcher.find()) {
|
||||
lineBreaks[lineNo++] = matcher.end();
|
||||
lineBreaks[lineNo] = matcher.end();
|
||||
lineNo++;
|
||||
}
|
||||
if (lineNo < lineBreaks.length) {
|
||||
lineBreaks[lineNo] = fullText.length();
|
||||
|
|
|
|||
|
|
@ -327,7 +327,8 @@ public class DescendantTokenCheck extends Check {
|
|||
final int[] result = new int[tokenNames.size()];
|
||||
int i = 0;
|
||||
for (String name : tokenNames) {
|
||||
result[i++] = Utils.getTokenId(name);
|
||||
result[i] = Utils.getTokenId(name);
|
||||
i++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,8 @@ public class HandlerFactory {
|
|||
final int[] types = new int[typeSet.size()];
|
||||
int index = 0;
|
||||
for (final Integer val : typeSet) {
|
||||
types[index++] = val;
|
||||
types[index] = val;
|
||||
index++;
|
||||
}
|
||||
|
||||
return types;
|
||||
|
|
|
|||
Loading…
Reference in New Issue