From 300a7cb0c2bb400a2728ead095a232647173038b 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:34:28 +0200 Subject: [PATCH] Store fingerprint in insert information. --- src/main/java/net/pterodactylus/sone/core/SoneInserter.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/SoneInserter.java b/src/main/java/net/pterodactylus/sone/core/SoneInserter.java index 1445613..d8564ba 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneInserter.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneInserter.java @@ -268,10 +268,10 @@ public class SoneInserter extends AbstractService { */ if (success) { synchronized (sone) { - if (lastInsertedFingerprint.equals(sone.getFingerprint())) { + if (insertInformation.getFingerprint().equals(sone.getFingerprint())) { logger.log(Level.FINE, String.format("Sone “%s” was not modified further, resetting counter…", sone)); lastModificationTime = absent(); - lastInsertFingerprint = lastInsertedFingerprint; + lastInsertFingerprint = insertInformation.getFingerprint(); core.touchConfiguration(); modified = false; } @@ -293,6 +293,8 @@ public class SoneInserter extends AbstractService { */ private class InsertInformation { + private final String fingerprint; + /** All properties of the Sone, copied for thread safety. */ private final Map soneProperties = new HashMap(); @@ -303,6 +305,7 @@ public class SoneInserter extends AbstractService { * The sone to insert */ public InsertInformation(Sone sone) { + this.fingerprint = sone.getFingerprint(); soneProperties.put("id", sone.getId()); soneProperties.put("name", sone.getName()); soneProperties.put("time", sone.getTime()); @@ -320,6 +323,10 @@ public class SoneInserter extends AbstractService { // ACCESSORS // + private String getFingerprint() { + return fingerprint; + } + /** * Returns the insert URI of the Sone. * -- 2.7.4