Suppress some warnings about variables hiding other variables.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 13 Sep 2011 08:30:19 +0000 (10:30 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 13 Sep 2011 08:32:55 +0000 (10:32 +0200)
src/main/java/net/pterodactylus/sone/core/Core.java
src/main/java/net/pterodactylus/sone/core/Options.java
src/main/java/net/pterodactylus/sone/data/Sone.java
src/main/java/net/pterodactylus/sone/freenet/SimpleFieldSetBuilder.java
src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java
src/main/java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java
src/main/java/net/pterodactylus/sone/main/SonePlugin.java
src/main/java/net/pterodactylus/sone/text/PartContainer.java
src/main/java/net/pterodactylus/sone/web/SearchPage.java

index c8d7588..0eaf296 100644 (file)
@@ -696,6 +696,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
         */
        public List<Reply> getReplies(Post post) {
                Set<Sone> sones = getSones();
+               @SuppressWarnings("hiding")
                List<Reply> replies = new ArrayList<Reply>();
                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<Post> getBookmarkedPosts() {
+               @SuppressWarnings("hiding")
                Set<Post> posts = new HashSet<Post>();
                synchronized (bookmarkedPosts) {
                        for (String bookmarkedPostId : bookmarkedPosts) {
@@ -1254,6 +1256,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                }
 
                /* load posts. */
+               @SuppressWarnings("hiding")
                Set<Post> posts = new HashSet<Post>();
                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<Reply> replies = new HashSet<Reply>();
                while (true) {
                        String replyPrefix = sonePrefix + "/Replies/" + replies.size();
index 1bdf21f..6a945b9 100644 (file)
@@ -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);
                }
 
index 3477346..fa3d78f 100644 (file)
@@ -658,6 +658,7 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
                }
                fingerprint.append(")");
 
+               @SuppressWarnings("hiding")
                List<Reply> replies = new ArrayList<Reply>(getReplies());
                Collections.sort(replies, Reply.TIME_COMPARATOR);
                fingerprint.append("Replies(");
@@ -666,6 +667,7 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
                }
                fingerprint.append(')');
 
+               @SuppressWarnings("hiding")
                List<String> likedPostIds = new ArrayList<String>(getLikedPostIds());
                Collections.sort(likedPostIds);
                fingerprint.append("LikedPosts(");
@@ -674,6 +676,7 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
                }
                fingerprint.append(')');
 
+               @SuppressWarnings("hiding")
                List<String> likedReplyIds = new ArrayList<String>(getLikedReplyIds());
                Collections.sort(likedReplyIds);
                fingerprint.append("LikedReplies(");
index 1d57454..37d049a 100644 (file)
@@ -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;
        }
index 3c97e55..803bc32 100644 (file)
@@ -178,6 +178,7 @@ public class IdentityManager extends AbstractService {
                Map<OwnIdentity, Map<String, Identity>> oldIdentities = Collections.emptyMap();
                while (!shouldStop()) {
                        Map<OwnIdentity, Map<String, Identity>> currentIdentities = new HashMap<OwnIdentity, Map<String, Identity>>();
+                       @SuppressWarnings("hiding")
                        Map<String, OwnIdentity> currentOwnIdentities = new HashMap<String, OwnIdentity>();
 
                        Set<OwnIdentity> ownIdentities = null;
index 59da039..b4ea53d 100644 (file)
@@ -77,6 +77,7 @@ public class WebOfTrustConnector implements ConnectorListener {
         *             if the own identities can not be loaded
         */
        public Set<OwnIdentity> 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<Identity> 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<Identity> identities = new HashSet<Identity>();
@@ -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) {
index d642dd8..91fb547 100644 (file)
@@ -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. */
index 384e8ae..88c889e 100644 (file)
@@ -107,6 +107,7 @@ public class PartContainer implements Part, Iterable<Part> {
                                }
                                noNextPart = true;
                                while (!partStack.isEmpty()) {
+                                       @SuppressWarnings("hiding")
                                        Iterator<Part> parts = partStack.pop();
                                        if (parts.hasNext()) {
                                                nextPart = parts.next();
index 91e2a08..42f0a82 100644 (file)
@@ -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);
                }