Skip to content

Commit e30ee71

Browse files
author
glelouet
committed
return instead of if ! for spring-guides#30
1 parent ec02ae8 commit e30ee71

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/example/schedulingtasks/ScheduledTasks.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ public void reportCurrentTime() {
4242

4343
@Scheduled(fixedRateString = "${my.app.time.report.cycle:8000}", initialDelayString = "${my.app.time.report.delay:0}")
4444
public void reportCurrentTimeParametered() {
45-
if (!skipReportTime) {
46-
log.info("[parametered] The time is now {}", dateFormat.format(new Date()));
45+
if (skipReportTime) {
46+
return;
4747
}
48+
log.info("[parametered] The time is now {}", dateFormat.format(new Date()));
4849
}
4950
}

0 commit comments

Comments
 (0)