From ad70977c3d0ca6a9b360de9300ba91475d2eb6a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 27 Sep 2011 22:17:18 +0200 Subject: [PATCH] Store LatestEdition property only after saving the Sone to disk. This will at least prevent WoT from blocking the correct writing of the configuration. --- src/main/java/net/pterodactylus/sone/core/Core.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 1bea477..1c9d668 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -2028,8 +2028,6 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis logger.log(Level.INFO, "Saving Sone: %s", sone); try { - ((OwnIdentity) sone.getIdentity()).setProperty("Sone.LatestEdition", String.valueOf(sone.getLatestEdition())); - /* save Sone into configuration. */ String sonePrefix = "Sone/" + sone.getId(); configuration.getLongValue(sonePrefix + "/Time").setValue(sone.getTime()); @@ -2135,6 +2133,9 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis configuration.getBooleanValue(sonePrefix + "/Options/EnableSoneInsertNotifications").setValue(sone.getOptions().getBooleanOption("EnableSoneInsertNotifications").getReal()); configuration.save(); + + ((OwnIdentity) sone.getIdentity()).setProperty("Sone.LatestEdition", String.valueOf(sone.getLatestEdition())); + logger.log(Level.INFO, "Sone %s saved.", sone); } catch (ConfigurationException ce1) { logger.log(Level.WARNING, "Could not save Sone: " + sone, ce1); -- 2.7.4