From: David ‘Bombe’ Roden Date: Tue, 13 Sep 2011 08:30:19 +0000 (+0200) Subject: Suppress some warnings about variables hiding other variables. X-Git-Tag: 0.7^2~10 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=dbb47149d5e2c1e67ec9889587ff24dd7c622862;p=Sone.git Suppress some warnings about variables hiding other variables. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index c8d7588..0eaf296 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -696,6 +696,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis */ public List getReplies(Post post) { Set sones = getSones(); + @SuppressWarnings("hiding") List replies = new ArrayList(); for (Sone sone : sones) { for (Reply reply : sone.getReplies()) { @@ -788,6 +789,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis * @return All bookmarked posts */ public Set getBookmarkedPosts() { + @SuppressWarnings("hiding") Set posts = new HashSet(); synchronized (bookmarkedPosts) { for (String bookmarkedPostId : bookmarkedPosts) { @@ -1254,6 +1256,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis } /* load posts. */ + @SuppressWarnings("hiding") Set posts = new HashSet(); while (true) { String postPrefix = sonePrefix + "/Posts/" + posts.size(); @@ -1276,6 +1279,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis } /* load replies. */ + @SuppressWarnings("hiding") Set replies = new HashSet(); while (true) { String replyPrefix = sonePrefix + "/Replies/" + replies.size(); diff --git a/src/main/java/net/pterodactylus/sone/core/Options.java b/src/main/java/net/pterodactylus/sone/core/Options.java index 1bdf21f..6a945b9 100644 --- a/src/main/java/net/pterodactylus/sone/core/Options.java +++ b/src/main/java/net/pterodactylus/sone/core/Options.java @@ -194,7 +194,7 @@ public class Options { * {@inheritDoc} */ @Override - public boolean validate(T value) { + public boolean validate(@SuppressWarnings("hiding") T value) { return (validator == null) || (value == null) || validator.validate(value); } diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 3477346..fa3d78f 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -658,6 +658,7 @@ public class Sone implements Fingerprintable, Comparable { } fingerprint.append(")"); + @SuppressWarnings("hiding") List replies = new ArrayList(getReplies()); Collections.sort(replies, Reply.TIME_COMPARATOR); fingerprint.append("Replies("); @@ -666,6 +667,7 @@ public class Sone implements Fingerprintable, Comparable { } fingerprint.append(')'); + @SuppressWarnings("hiding") List likedPostIds = new ArrayList(getLikedPostIds()); Collections.sort(likedPostIds); fingerprint.append("LikedPosts("); @@ -674,6 +676,7 @@ public class Sone implements Fingerprintable, Comparable { } fingerprint.append(')'); + @SuppressWarnings("hiding") List likedReplyIds = new ArrayList(getLikedReplyIds()); Collections.sort(likedReplyIds); fingerprint.append("LikedReplies("); diff --git a/src/main/java/net/pterodactylus/sone/freenet/SimpleFieldSetBuilder.java b/src/main/java/net/pterodactylus/sone/freenet/SimpleFieldSetBuilder.java index 1d57454..37d049a 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/SimpleFieldSetBuilder.java +++ b/src/main/java/net/pterodactylus/sone/freenet/SimpleFieldSetBuilder.java @@ -67,7 +67,7 @@ public class SimpleFieldSetBuilder { * The simple field set to copy * @return This simple field set builder */ - public SimpleFieldSetBuilder put(SimpleFieldSet simpleFieldSet) { + public SimpleFieldSetBuilder put(@SuppressWarnings("hiding") SimpleFieldSet simpleFieldSet) { this.simpleFieldSet.putAllOverwrite(simpleFieldSet); return this; } diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java index 3c97e55..803bc32 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java @@ -178,6 +178,7 @@ public class IdentityManager extends AbstractService { Map> oldIdentities = Collections.emptyMap(); while (!shouldStop()) { Map> currentIdentities = new HashMap>(); + @SuppressWarnings("hiding") Map currentOwnIdentities = new HashMap(); Set ownIdentities = null; diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java b/src/main/java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java index 59da039..b4ea53d 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java @@ -77,6 +77,7 @@ public class WebOfTrustConnector implements ConnectorListener { * if the own identities can not be loaded */ public Set loadAllOwnIdentities() throws WebOfTrustException { + @SuppressWarnings("hiding") Reply reply = performRequest(SimpleFieldSetConstructor.create().put("Message", "GetOwnIdentities").get()); SimpleFieldSet fields = reply.getFields(); int ownIdentityCounter = -1; @@ -124,6 +125,7 @@ public class WebOfTrustConnector implements ConnectorListener { * if an error occured talking to the Web of Trust plugin */ public Set loadTrustedIdentities(OwnIdentity ownIdentity, String context) throws PluginException { + @SuppressWarnings("hiding") Reply reply = performRequest(SimpleFieldSetConstructor.create().put("Message", "GetIdentitiesByScore").put("TreeOwner", ownIdentity.getId()).put("Selection", "+").put("Context", (context == null) ? "" : context).get()); SimpleFieldSet fields = reply.getFields(); Set identities = new HashSet(); @@ -183,6 +185,7 @@ public class WebOfTrustConnector implements ConnectorListener { * if an error occured talking to the Web of Trust plugin */ public String getProperty(Identity identity, String name) throws PluginException { + @SuppressWarnings("hiding") Reply reply = performRequest(SimpleFieldSetConstructor.create().put("Message", "GetProperty").put("Identity", identity.getId()).put("Property", name).get()); return reply.getFields().get("Property"); } @@ -396,7 +399,7 @@ public class WebOfTrustConnector implements ConnectorListener { * {@inheritDoc} */ @Override - public void receivedReply(PluginConnector pluginConnector, SimpleFieldSet fields, Bucket data) { + public void receivedReply(@SuppressWarnings("hiding") PluginConnector pluginConnector, SimpleFieldSet fields, Bucket data) { String messageName = fields.get("Message"); logger.log(Level.FINEST, "Received Reply from Plugin: " + messageName); synchronized (reply) { diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index d642dd8..91fb547 100644 --- a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java @@ -145,7 +145,7 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr * {@inheritDoc} */ @Override - public void runPlugin(PluginRespirator pluginRespirator) { + public void runPlugin(@SuppressWarnings("hiding") PluginRespirator pluginRespirator) { this.pluginRespirator = pluginRespirator; /* create a configuration. */ diff --git a/src/main/java/net/pterodactylus/sone/text/PartContainer.java b/src/main/java/net/pterodactylus/sone/text/PartContainer.java index 384e8ae..88c889e 100644 --- a/src/main/java/net/pterodactylus/sone/text/PartContainer.java +++ b/src/main/java/net/pterodactylus/sone/text/PartContainer.java @@ -107,6 +107,7 @@ public class PartContainer implements Part, Iterable { } noNextPart = true; while (!partStack.isEmpty()) { + @SuppressWarnings("hiding") Iterator parts = partStack.pop(); if (parts.hasNext()) { nextPart = parts.next(); diff --git a/src/main/java/net/pterodactylus/sone/web/SearchPage.java b/src/main/java/net/pterodactylus/sone/web/SearchPage.java index 91e2a08..42f0a82 100644 --- a/src/main/java/net/pterodactylus/sone/web/SearchPage.java +++ b/src/main/java/net/pterodactylus/sone/web/SearchPage.java @@ -457,6 +457,7 @@ public class SearchPage extends SoneTemplatePage { if (!(object instanceof Phrase)) { return false; } + @SuppressWarnings("hiding") Phrase phrase = (Phrase) object; return (this.optionality == phrase.optionality) && this.phrase.equals(phrase.phrase); }