Skip to content

Commit 496f198

Browse files
committed
ScriptModule: clean up output flushing code style
1 parent cc8be65 commit 496f198

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/main/java/org/scijava/script/ScriptModule.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,19 +197,17 @@ public void run() {
197197
setOutput(name, typed);
198198
}
199199

200-
if (output != null) try {
201-
output.flush();
202-
} catch (IOException e) {
203-
if (error == null) {
204-
log.error(e);
205-
} else {
206-
e.printStackTrace(errorPrinter);
200+
// flush output and error streams
201+
if (output != null) {
202+
try {
203+
output.flush();
204+
}
205+
catch (final IOException e) {
206+
if (error == null) log.error(e);
207+
else e.printStackTrace(errorPrinter);
207208
}
208209
}
209-
210-
if (errorPrinter != null) {
211-
errorPrinter.flush();
212-
}
210+
if (errorPrinter != null) errorPrinter.flush();
213211
}
214212

215213
// -- Contextual methods --

0 commit comments

Comments
 (0)