Issue #1566: ModifiedControlVariable violations fixed
This commit is contained in:
parent
d808a4e4d9
commit
242028813d
|
|
@ -303,6 +303,8 @@
|
|||
<property name="setterCanReturnItsClass" value="true"/>
|
||||
</module>
|
||||
|
||||
<module name="ModifiedControlVariable"/>
|
||||
|
||||
<!--
|
||||
<module name="AvoidInlineConditionals"/>
|
||||
<module name="ClassDataAbstractionCoupling"/>
|
||||
|
|
@ -317,7 +319,6 @@
|
|||
<module name="JavadocTagContinuationIndentation"/>
|
||||
<module name="JavaNCSS"/>
|
||||
<module name="MissingCtor"/>
|
||||
<module name="ModifiedControlVariable"/>
|
||||
<module name="MultipleStringLiterals"/>
|
||||
<module name="NPathComplexity"/>
|
||||
<module name="OneTopLevelClass"/>
|
||||
|
|
|
|||
|
|
@ -217,11 +217,12 @@ public class SuppressWarningsHolder
|
|||
final List<Entry> entries = ENTRIES.get();
|
||||
if (entries != null) {
|
||||
for (String value : values) {
|
||||
String checkName = value;
|
||||
// strip off the checkstyle-only prefix if present
|
||||
if (value.startsWith(CHECKSTYLE_PREFIX)) {
|
||||
value = value.substring(CHECKSTYLE_PREFIX.length());
|
||||
checkName = checkName.substring(CHECKSTYLE_PREFIX.length());
|
||||
}
|
||||
entries.add(new Entry(value, firstLine, firstColumn,
|
||||
entries.add(new Entry(checkName, firstLine, firstColumn,
|
||||
lastLine, lastColumn));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ public final class MissingDeprecatedCheck extends Check {
|
|||
|
||||
boolean found = false;
|
||||
for (int reindex = i + 1;
|
||||
reindex < lines.length; reindex++) {
|
||||
reindex < lines.length;) {
|
||||
final Matcher multilineCont = MATCH_DEPRECATED_MULTILINE_CONT.matcher(lines[reindex]);
|
||||
|
||||
if (multilineCont.find()) {
|
||||
|
|
@ -231,6 +231,7 @@ public final class MissingDeprecatedCheck extends Check {
|
|||
found = true;
|
||||
}
|
||||
}
|
||||
reindex++;
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ public class JavadocStyleCheck
|
|||
*/
|
||||
private static int findTextStart(String line) {
|
||||
int textStart = -1;
|
||||
for (int i = 0; i < line.length(); i++) {
|
||||
for (int i = 0; i < line.length();) {
|
||||
if (!Character.isWhitespace(line.charAt(i))) {
|
||||
if (line.regionMatches(i, "/**", 0, "/**".length())) {
|
||||
i += 2;
|
||||
|
|
@ -307,6 +307,7 @@ public class JavadocStyleCheck
|
|||
break;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return textStart;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue