From 5da14d9050891ca83a70227ecb48f6fe70eb6e1c Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 21 Sep 2011 10:28:52 +0200 Subject: [PATCH] Remove unnecessary warning suppressions. --- src/main/java/net/pterodactylus/sone/core/Options.java | 2 +- src/main/java/net/pterodactylus/sone/data/Sone.java | 3 --- .../java/net/pterodactylus/sone/freenet/SimpleFieldSetBuilder.java | 2 +- .../java/net/pterodactylus/sone/freenet/wot/IdentityManager.java | 1 - .../java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java | 5 +---- src/main/java/net/pterodactylus/sone/text/PartContainer.java | 1 - src/main/java/net/pterodactylus/sone/web/SearchPage.java | 1 - 7 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/Options.java b/src/main/java/net/pterodactylus/sone/core/Options.java index 6a945b9..1bdf21f 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(@SuppressWarnings("hiding") T value) { + public boolean validate(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 b8db269..8ffeed5 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -707,7 +707,6 @@ public class Sone implements Fingerprintable, Comparable { } fingerprint.append(")"); - @SuppressWarnings("hiding") List replies = new ArrayList(getReplies()); Collections.sort(replies, Reply.TIME_COMPARATOR); fingerprint.append("Replies("); @@ -716,7 +715,6 @@ public class Sone implements Fingerprintable, Comparable { } fingerprint.append(')'); - @SuppressWarnings("hiding") List likedPostIds = new ArrayList(getLikedPostIds()); Collections.sort(likedPostIds); fingerprint.append("LikedPosts("); @@ -725,7 +723,6 @@ 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 37d049a..1d57454 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(@SuppressWarnings("hiding") SimpleFieldSet simpleFieldSet) { + public SimpleFieldSetBuilder put(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 803bc32..3c97e55 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java @@ -178,7 +178,6 @@ 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 b4ea53d..59da039 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java @@ -77,7 +77,6 @@ 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; @@ -125,7 +124,6 @@ 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(); @@ -185,7 +183,6 @@ 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"); } @@ -399,7 +396,7 @@ public class WebOfTrustConnector implements ConnectorListener { * {@inheritDoc} */ @Override - public void receivedReply(@SuppressWarnings("hiding") PluginConnector pluginConnector, SimpleFieldSet fields, Bucket data) { + public void receivedReply(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/text/PartContainer.java b/src/main/java/net/pterodactylus/sone/text/PartContainer.java index 88c889e..384e8ae 100644 --- a/src/main/java/net/pterodactylus/sone/text/PartContainer.java +++ b/src/main/java/net/pterodactylus/sone/text/PartContainer.java @@ -107,7 +107,6 @@ 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 42f0a82..91e2a08 100644 --- a/src/main/java/net/pterodactylus/sone/web/SearchPage.java +++ b/src/main/java/net/pterodactylus/sone/web/SearchPage.java @@ -457,7 +457,6 @@ 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); } -- 2.7.4