From 8f2392b1ad71157ffdbc78f8074d5a35543c8c75 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 11 Jun 2014 06:28:25 +0200 Subject: [PATCH] Use a real boolean to signal that the Sone should be inserted now. --- src/main/java/net/pterodactylus/sone/core/SoneInserter.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/SoneInserter.java b/src/main/java/net/pterodactylus/sone/core/SoneInserter.java index d5fe9a2..1445613 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneInserter.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneInserter.java @@ -212,7 +212,7 @@ public class SoneInserter extends AbstractService { continue; } - InsertInformation insertInformation = null; + boolean insertSoneNow = false; synchronized (sone) { String fingerprint = sone.getFingerprint(); if (!fingerprint.equals(lastFingerprint)) { @@ -229,11 +229,12 @@ public class SoneInserter extends AbstractService { } if (modified && lastModificationTime.isPresent() && ((currentTimeMillis() - lastModificationTime.get()) > (insertionDelay * 1000))) { lastInsertedFingerprint = fingerprint; - insertInformation = new InsertInformation(sone); + insertSoneNow = true; } } - if (insertInformation != null) { + if (insertSoneNow) { + InsertInformation insertInformation = new InsertInformation(sone); logger.log(Level.INFO, String.format("Inserting Sone “%s”…", sone.getName())); boolean success = false; -- 2.7.4