From: David ‘Bombe’ Roden Date: Wed, 11 Jun 2014 04:28:25 +0000 (+0200) Subject: Use a real boolean to signal that the Sone should be inserted now. X-Git-Tag: 0.9-rc1^2~3^2~246 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=8f2392b1ad71157ffdbc78f8074d5a35543c8c75;p=Sone.git Use a real boolean to signal that the Sone should be inserted now. --- 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;