From c87911369ba505171e19dfa2f88129a209ee389b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 13 Oct 2010 16:17:31 +0200 Subject: [PATCH] Remove warning about parameter assignment. --- src/main/java/net/pterodactylus/sone/core/Core.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 7498356..ddca79f 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -137,15 +137,20 @@ public class Core extends AbstractService { if ((name == null) || (name.trim().length() == 0)) { throw new SoneException(Type.INVALID_SONE_NAME); } + String finalRequestUri; + String finalInsertUri; if ((requestUri == null) || (insertUri == null)) { String[] keyPair = freenetInterface.generateKeyPair(); - requestUri = keyPair[0]; - insertUri = keyPair[1]; + finalRequestUri = keyPair[0]; + finalInsertUri = keyPair[1]; + } else { + finalRequestUri = requestUri; + finalInsertUri = insertUri; } Sone sone; try { - logger.log(Level.FINEST, "Creating new Sone “%s” at %s (%s)…", new Object[] { name, requestUri, insertUri }); - sone = new Sone(UUID.randomUUID(), name, new FreenetURI(requestUri), new FreenetURI(insertUri)); + logger.log(Level.FINEST, "Creating new Sone “%s” at %s (%s)…", new Object[] { name, finalRequestUri, finalInsertUri }); + sone = new Sone(UUID.randomUUID(), name, new FreenetURI(finalRequestUri), new FreenetURI(finalInsertUri)); } catch (MalformedURLException mue1) { throw new SoneException(Type.INVALID_URI); } -- 2.7.4