From d9ff777c483f3fea071a9cf8dd7c40e792fd8f1e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 8 Nov 2010 08:56:07 +0100 Subject: [PATCH] Set latest edition more effectively. --- src/main/java/net/pterodactylus/sone/core/Core.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 73f7410..83f7e6c 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -486,7 +486,8 @@ public class Core implements IdentityListener { } synchronized (remoteSones) { final Sone sone = getRemoteSone(identity.getId()).setIdentity(identity); - sone.setRequestUri(getSoneUri(identity.getRequestUri(), identity.getProperty("Sone.LatestEdition"))); + sone.setRequestUri(getSoneUri(identity.getRequestUri())); + sone.setLatestEdition(Numbers.safeParseLong(identity.getProperty("Sone.LatestEdition"), (long) 0)); remoteSones.put(identity.getId(), sone); soneDownloader.addSone(sone); new Thread(new Runnable() { @@ -957,13 +958,11 @@ public class Core implements IdentityListener { * * @param uriString * The URI to derive the Sone URI from - * @param latestEditionString - * The latest edition as a {@link String}, or {@code null} * @return The derived URI */ - private FreenetURI getSoneUri(String uriString, String latestEditionString) { + private FreenetURI getSoneUri(String uriString) { try { - FreenetURI uri = new FreenetURI(uriString).setDocName("Sone").setMetaString(new String[0]).setSuggestedEdition(Numbers.safeParseLong(latestEditionString, (long) 0)); + FreenetURI uri = new FreenetURI(uriString).setDocName("Sone").setMetaString(new String[0]); return uri; } catch (MalformedURLException mue1) { logger.log(Level.WARNING, "Could not create Sone URI from URI: " + uriString, mue1); -- 2.7.4