Skip to content

Commit 0d4abbe

Browse files
author
alexandre.monterroso
committed
Avoid repetition
1 parent 0687c9a commit 0d4abbe

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

core/src/main/java/cucumber/runtime/formatter/PrettyFormatter.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,10 @@ private void handleTestStepFinished(TestStepFinished event) {
153153
private void handleWrite(WriteEvent event) {
154154
out.println();
155155
try(BufferedReader lines = new BufferedReader(new StringReader(event.text))) {
156-
String line = lines.readLine();
157-
while(line != null) {
158-
out.println(STEP_SCENARIO_INDENT + line);
159-
line = lines.readLine();
160-
}
156+
String line;
157+
while ((line = lines.readLine()) != null) {
158+
out.println(STEP_SCENARIO_INDENT + line);
159+
}
161160
} catch (IOException e) {
162161
throw new CucumberException(e);
163162
}

0 commit comments

Comments
 (0)