Fix wrong null check

This commit is contained in:
Manfred Karrer 2016-02-19 22:24:55 +01:00
parent 8b1c0e5e6f
commit a406a94976
2 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ public class DefaultJavaTimer implements Timer {
@Override
public Timer runLater(Duration delay, Runnable runnable) {
if (timer != null) {
if (timer == null) {
timer = new java.util.Timer();
timer.schedule(new TimerTask() {
@Override
@ -39,7 +39,7 @@ public class DefaultJavaTimer implements Timer {
@Override
public Timer runPeriodically(java.time.Duration interval, Runnable runnable) {
if (timer != null) {
if (timer == null) {
timer = new java.util.Timer();
timer.scheduleAtFixedRate(new TimerTask() {
@Override

View File

@ -16,7 +16,7 @@ public class UITimer implements Timer {
@Override
public Timer runLater(Duration delay, Runnable runnable) {
if (timer != null) {
if (timer == null) {
timer = FxTimer.create(delay, runnable);
timer.restart();
} else {
@ -27,7 +27,7 @@ public class UITimer implements Timer {
@Override
public Timer runPeriodically(Duration interval, Runnable runnable) {
if (timer != null) {
if (timer == null) {
timer = FxTimer.createPeriodic(interval, runnable);
timer.restart();
} else {