Skip to content

Commit f3b1a08

Browse files
nrmancusoromani
authored andcommitted
minor: renaming to comply with new config rules in main repo
1 parent 9c88282 commit f3b1a08

14 files changed

+50
-46
lines changed

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/annotation/ForbidAnnotationCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public void setAnnotationNames(final String... names) {
7979
public void setAnnotationTargets(String... targets) {
8080
if (targets != null) {
8181
annotationTargets = new int[targets.length];
82-
for (int i = 0; i < targets.length; i++) {
83-
annotationTargets[i] = TokenUtil.getTokenId(targets[i]);
82+
for (int index = 0; index < targets.length; index++) {
83+
annotationTargets[index] = TokenUtil.getTokenId(targets[index]);
8484
}
8585
Arrays.sort(annotationTargets);
8686
}

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/AvoidConstantAsFirstOperandInConditionCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public class AvoidConstantAsFirstOperandInConditionCheck extends AbstractCheck {
8585
public void setTargetConstantTypes(String... targets) {
8686
if (targets != null) {
8787
targetConstantTypes = new int[targets.length];
88-
for (int i = 0; i < targets.length; i++) {
89-
targetConstantTypes[i] = TokenUtil.getTokenId(targets[i]);
88+
for (int index = 0; index < targets.length; index++) {
89+
targetConstantTypes[index] = TokenUtil.getTokenId(targets[index]);
9090
}
9191
Arrays.sort(targetConstantTypes);
9292
}

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/CustomDeclarationOrderCheck.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ public int[] getDefaultTokens() {
337337
final int size = customOrderDeclaration.size();
338338
final int[] tokenTypes = new int[size + 1];
339339

340-
for (int i = 0; i < size; i++) {
341-
final FormatMatcher currentRule = customOrderDeclaration.get(i);
342-
tokenTypes[i] = currentRule.getClassMember();
340+
for (int index = 0; index < size; index++) {
341+
final FormatMatcher currentRule = customOrderDeclaration.get(index);
342+
tokenTypes[index] = currentRule.getClassMember();
343343

344344
if (currentRule.hasRule(INNER_CLASS_MACRO)) {
345345
checkInnerClasses = true;
@@ -1371,8 +1371,8 @@ public Map<DetailAST, DetailAST> getWrongOrderedGettersSetters() {
13711371
// sort by line numbers
13721372
Collections.sort(allGettersSetters, AST_LINE_COMPARATOR);
13731373

1374-
for (int i = 0; i < allGettersSetters.size(); i++) {
1375-
result.putAll(getWrongOrderedGettersSetters(allGettersSetters, i));
1374+
for (int index = 0; index < allGettersSetters.size(); index++) {
1375+
result.putAll(getWrongOrderedGettersSetters(allGettersSetters, index));
13761376
}
13771377
}
13781378
return result;
@@ -1402,17 +1402,19 @@ else if (isBooleanGetterName(getterName)) {
14021402

14031403
if (getterField != null) {
14041404
// review rest of the list to find a proper setter
1405-
for (int j = 0; j < allGettersSetters.size(); j++) {
1406-
if (index != j) {
1405+
for (int allGettersSettersIndex = 0;
1406+
allGettersSettersIndex < allGettersSetters.size();
1407+
allGettersSettersIndex++) {
1408+
if (index != allGettersSettersIndex) {
14071409
// method is NOT getter
1408-
final DetailAST setterAst = allGettersSetters.get(j);
1410+
final DetailAST setterAst = allGettersSetters.get(allGettersSettersIndex);
14091411
final String setterName = getIdentifier(setterAst);
14101412
if (isSetterName(setterName)) {
14111413
final String setterField = getNameWithoutPrefix(
14121414
getIdentifier(setterAst), SETTER_PREFIX);
14131415

14141416
// if fields are same and setter is sibling with getter
1415-
if (j != index + 1
1417+
if (allGettersSettersIndex != index + 1
14161418
&& getterField.equals(setterField)) {
14171419
result.put(setterAst, getterAst);
14181420
break;

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/IllegalCatchExtendedCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ private static DetailAST[] getChilds(DetailAST node) {
185185

186186
DetailAST currNode = node.getFirstChild();
187187

188-
for (int i = 0; i < result.length; i++) {
189-
result[i] = currNode;
188+
for (int index = 0; index < result.length; index++) {
189+
result[index] = currNode;
190190
currNode = currNode.getNextSibling();
191191
}
192192

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/NumericLiteralNeedsUnderscoreCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,8 @@ private static boolean numericSegmentPassesRequirement(String numericSegment,
581581
final char underscore = '_';
582582
int symbolCount = 0;
583583

584-
for (int i = 0; i < numericSegment.length(); i++) {
585-
final char current = numericSegment.charAt(i);
584+
for (int index = 0; index < numericSegment.length(); index++) {
585+
final char current = numericSegment.charAt(index);
586586
if (symbolCount >= symbolsUntilUnderscore && current != underscore) {
587587
passes = false;
588588
break;

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/RequireFailForTryCatchInJunitCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ private boolean isTestMethod(DetailAST method) {
345345
boolean result = false;
346346
if (method != null) {
347347
result = importTest && AnnotationUtil.containsAnnotation(method, "Test");
348-
for (int i = 0; !result && i < FQ_JUNIT_TESTS.size(); i++) {
349-
result = AnnotationUtil.containsAnnotation(method, FQ_JUNIT_TESTS.get(i));
348+
for (int index = 0; !result && index < FQ_JUNIT_TESTS.size(); index++) {
349+
result = AnnotationUtil.containsAnnotation(method, FQ_JUNIT_TESTS.get(index));
350350
}
351351
}
352352
return result;

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/SimpleAccessorNameNotationCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ private static boolean checkNameOfParameters(DetailAST parameters,
357357
final DetailAST parameterDef = parameters
358358
.findFirstToken(TokenTypes.PARAMETER_DEF);
359359

360-
for (int i = 0; i < parametersChildCount && !isNameOfParameter; i++) {
360+
for (int index = 0; index < parametersChildCount && !isNameOfParameter; index++) {
361361
isNameOfParameter = parameterDef.findFirstToken(TokenTypes.IDENT).getText()
362362
.equals(fieldName);
363363
}

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/TernaryPerExpressionCountCheck.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ private boolean isIsolatedTernaryOnLine(DetailAST questionAST) {
251251
private boolean isSingleTernaryLine(String line, int lineNo) {
252252
int questionsPerLine = 0;
253253
final char[] charArrayFromLine = line.toCharArray();
254-
for (int i = 0; i < line.length(); i++) {
255-
final char currentSymbol = charArrayFromLine[i];
254+
for (int index = 0; index < line.length(); index++) {
255+
final char currentSymbol = charArrayFromLine[index];
256256
if (currentSymbol == '?' && !getFileContents().hasIntersectionWithComment(lineNo + 1,
257-
i, lineNo + 1, i)) {
257+
index, lineNo + 1, index)) {
258258
questionsPerLine++;
259259
}
260260
if (questionsPerLine > 1) {

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/UnnecessaryParenthesesExtendedCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ private static boolean inTokenList(int type, int... tokens) {
324324
// HashMap to do the searches.
325325

326326
boolean found = false;
327-
for (int i = 0; i < tokens.length && !found; i++) {
328-
found = tokens[i] == type;
327+
for (int index = 0; index < tokens.length && !found; index++) {
328+
found = tokens[index] == type;
329329
}
330330
return found;
331331
}

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/design/ChildBlockLengthCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ public class ChildBlockLengthCheck extends AbstractCheck {
104104
**/
105105
public void setBlockTypes(final String... blockTypes) {
106106
this.blockTypes = new int[blockTypes.length];
107-
for (int i = 0; i < blockTypes.length; i++) {
108-
this.blockTypes[i] = TokenUtil.getTokenId(blockTypes[i]);
107+
for (int index = 0; index < blockTypes.length; index++) {
108+
this.blockTypes[index] = TokenUtil.getTokenId(blockTypes[index]);
109109
}
110110
}
111111

0 commit comments

Comments
 (0)