From bee5ee7cce3d0cf1691d5bf18fbd6010b0027b37 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Tue, 27 Jan 2015 17:00:20 +0100 Subject: [PATCH] removed some warnings --- htroot/ViewImage.java | 3 +-- htroot/api/snapshot.java | 1 - .../cora/federate/AbstractFederateSearchConnector.java | 8 +++----- source/net/yacy/cora/federate/FederateSearchManager.java | 3 +-- source/net/yacy/crawler/data/CrawlQueues.java | 3 --- source/net/yacy/http/servlets/UrlProxyServlet.java | 1 - source/net/yacy/search/AutoSearch.java | 6 ++---- source/net/yacy/search/snippet/ResultEntry.java | 1 - source/net/yacy/server/http/HTTPDemon.java | 1 - 9 files changed, 7 insertions(+), 20 deletions(-) diff --git a/htroot/ViewImage.java b/htroot/ViewImage.java index d07cfae3c..7bf0dab3c 100644 --- a/htroot/ViewImage.java +++ b/htroot/ViewImage.java @@ -154,9 +154,8 @@ public class ViewImage { image = ImageParser.parse(urlString, imgb); if (image == null) { return null; - } else { - if ((auth && (width == 0 || height == 0) && maxwidth == 0 && maxheight == 0)) return ext == null ? image : new EncodedImage(image, ext, isStatic); } + if ((auth && (width == 0 || height == 0) && maxwidth == 0 && maxheight == 0)) return ext == null ? image : new EncodedImage(image, ext, isStatic); // find original size final int h = image.getHeight(null); final int w = image.getWidth(null); diff --git a/htroot/api/snapshot.java b/htroot/api/snapshot.java index 427ed00d0..2a32c529d 100644 --- a/htroot/api/snapshot.java +++ b/htroot/api/snapshot.java @@ -38,7 +38,6 @@ import net.yacy.cora.document.encoding.UTF8; import net.yacy.cora.document.feed.RSSFeed; import net.yacy.cora.document.feed.RSSMessage; import net.yacy.cora.document.id.DigestURL; -import net.yacy.cora.protocol.ClientIdentification; import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.util.ConcurrentLog; import net.yacy.cora.util.Html2Image; diff --git a/source/net/yacy/cora/federate/AbstractFederateSearchConnector.java b/source/net/yacy/cora/federate/AbstractFederateSearchConnector.java index 48fd05134..b9e7c297a 100644 --- a/source/net/yacy/cora/federate/AbstractFederateSearchConnector.java +++ b/source/net/yacy/cora/federate/AbstractFederateSearchConnector.java @@ -87,14 +87,12 @@ abstract public class AbstractFederateSearchConnector implements FederateSearchC // mandatory to contain a mapping for "sku" or alternatively "cfg_skufieldname" for a conversion to a final url if (this.localcfg.contains(CollectionSchema.sku) || this.localcfg.contains("_skufieldname")) { return true; - } else { - ConcurrentLog.config(this.instancename, "mandatory mapping for sku or _skufieldname missing in " + cfgFileName); - return false; } - } else { - this.localcfg = null; + ConcurrentLog.config(this.instancename, "mandatory mapping for sku or _skufieldname missing in " + cfgFileName); return false; } + this.localcfg = null; + return false; } /** diff --git a/source/net/yacy/cora/federate/FederateSearchManager.java b/source/net/yacy/cora/federate/FederateSearchManager.java index 8d2ba017d..32e763740 100644 --- a/source/net/yacy/cora/federate/FederateSearchManager.java +++ b/source/net/yacy/cora/federate/FederateSearchManager.java @@ -164,9 +164,8 @@ public class FederateSearchManager { sdl.addAll(fsc.query(query)); } return sdl; - } else { - return null; } + return null; } /** diff --git a/source/net/yacy/crawler/data/CrawlQueues.java b/source/net/yacy/crawler/data/CrawlQueues.java index b02a38a95..2cb296eec 100644 --- a/source/net/yacy/crawler/data/CrawlQueues.java +++ b/source/net/yacy/crawler/data/CrawlQueues.java @@ -492,9 +492,6 @@ public class CrawlQueues { // we know a peer which should provide remote crawl entries. load them now. final RSSFeed feed = Protocol.queryRemoteCrawlURLs(this.sb.peers, seed, 60, 10000); if (feed == null || feed.isEmpty()) { - // something is wrong with this provider. To prevent that we get not stuck with this peer - // we remove it from the peer list - this.sb.peers.peerActions.peerDeparture(seed, "no results from provided remote crawls"); // try again and ask another peer return remoteCrawlLoaderJob(); } diff --git a/source/net/yacy/http/servlets/UrlProxyServlet.java b/source/net/yacy/http/servlets/UrlProxyServlet.java index 9dd83f05b..20d5722fc 100644 --- a/source/net/yacy/http/servlets/UrlProxyServlet.java +++ b/source/net/yacy/http/servlets/UrlProxyServlet.java @@ -21,7 +21,6 @@ import net.yacy.cora.document.id.DigestURL; import net.yacy.cora.protocol.ClientIdentification; import net.yacy.cora.protocol.Domains; import net.yacy.cora.protocol.HeaderFramework; -import static net.yacy.cora.protocol.HeaderFramework.http1_1; import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.protocol.ResponseHeader; import net.yacy.cora.util.ConcurrentLog; diff --git a/source/net/yacy/search/AutoSearch.java b/source/net/yacy/search/AutoSearch.java index 5605defd0..bd0a071de 100644 --- a/source/net/yacy/search/AutoSearch.java +++ b/source/net/yacy/search/AutoSearch.java @@ -182,9 +182,8 @@ public class AutoSearch extends AbstractBusyThread { this.lastInitTime = System.currentTimeMillis(); saveasPropFile(); return true; - } else { - return false; } + return false; } /** @@ -305,9 +304,8 @@ public class AutoSearch extends AbstractBusyThread { int cnt = currentTargets.size(); cnt += querystack.size() * sb.peers.sizeConnected(); return cnt; - } else { - return 0; } + return 0; } @Override diff --git a/source/net/yacy/search/snippet/ResultEntry.java b/source/net/yacy/search/snippet/ResultEntry.java index 2ff9233d0..4201416c1 100644 --- a/source/net/yacy/search/snippet/ResultEntry.java +++ b/source/net/yacy/search/snippet/ResultEntry.java @@ -27,7 +27,6 @@ package net.yacy.search.snippet; import java.io.IOException; -import java.net.MalformedURLException; import java.util.Comparator; import java.util.Date; diff --git a/source/net/yacy/server/http/HTTPDemon.java b/source/net/yacy/server/http/HTTPDemon.java index b4695b2f7..f2c3b0c75 100644 --- a/source/net/yacy/server/http/HTTPDemon.java +++ b/source/net/yacy/server/http/HTTPDemon.java @@ -30,7 +30,6 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; -import java.net.InetAddress; import java.net.MalformedURLException; import java.util.Date; import java.util.HashMap;