Issue #1555: Replace while with foreach

Fixes `WhileCanBeForeach` inspection violation.

Description:
>Reports while loops which iterate over collections, and can be replaced with the foreach iteration syntax, which is available in Java 5 and newer.
This inspection only reports if the project or module is configured to use a language level of 5.0 or higher.
This commit is contained in:
Michal Kordas 2015-08-30 10:49:08 +02:00 committed by Roman Ivanov
parent 190ce3850f
commit e1a2e66b26
1 changed files with 3 additions and 5 deletions

View File

@ -497,11 +497,9 @@ public class JavadocMethodCheck extends AbstractTypeAwareCheck {
}
// Dump out all unused tags
final Iterator<JavadocTag> unusedTagIt = tags.iterator();
while (unusedTagIt.hasNext()) {
final JavadocTag jt = unusedTagIt.next();
if (!jt.isSeeOrInheritDocTag()) {
log(jt.getLineNo(), MSG_UNUSED_TAG_GENERAL);
for (JavadocTag javadocTag : tags) {
if (!javadocTag.isSeeOrInheritDocTag()) {
log(javadocTag.getLineNo(), MSG_UNUSED_TAG_GENERAL);
}
}
}