Remove nested assignment. #1555

Fixes `NestedAssignment` inspection violation in test code.

Description:
>Reports assignment expressions nested inside other expressions. While 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:
Michal Kordas 2015-08-17 22:33:34 +02:00 committed by Roman Ivanov
parent b02dba99c5
commit 06863d123f
1 changed files with 5 additions and 1 deletions

View File

@ -102,7 +102,11 @@ public class ConfigurationBuilder extends BaseCheckTestSupport {
int lineNumber = 1;
List<Integer> result = new ArrayList<>();
try(BufferedReader br = new BufferedReader(new FileReader(aFileName))) {
for(String line; (line = br.readLine()) != null; ) {
while (true) {
String line = br.readLine();
if (line == null) {
break;
}
if (warnPattern.matcher(line).find()) {
result.add(lineNumber);
}