Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
replaced more size() > 0 by !isEmpty()
orbiterbbfa497a3c9c
diff --git a/htroot/CrawlStartScanner_p.java b/htroot/CrawlStartScanner_p.javaindex 8ab084a18..371cd9372 100644--- a/htroot/CrawlStartScanner_p.java+++ b/htroot/CrawlStartScanner_p.java@@ -72,7 +72,7 @@ public class CrawlStartScanner_pif ( hosts.isEmpty() ) {InetAddress ip;if ( sb.isIntranetMode() ) {- if ( ips.size() > 0 ) {+ if ( !ips.isEmpty() ) {ip = ips.iterator().next();} else {ip = Domains.dnsResolve("192.168.0.1");diff --git a/htroot/IndexImportOAIPMH_p.java b/htroot/IndexImportOAIPMH_p.javaindex c627f1c4e..518ae6b07 100644--- a/htroot/IndexImportOAIPMH_p.java+++ b/htroot/IndexImportOAIPMH_p.java@@ -127,7 +127,7 @@ public class IndexImportOAIPMH_p {// start jobs for the sourcesDigestURI url = null;- while (sourceList.size() > 0) {+ while (!sourceList.isEmpty()) {final String oaipmhurl = sourceList.remove(r.nextInt(sourceList.size()));try {url = new DigestURI(oaipmhurl);diff --git a/htroot/Status.java b/htroot/Status.javaindex 7c6ed1e43..e82dea65f 100644--- a/htroot/Status.java+++ b/htroot/Status.java@@ -72,7 +72,7 @@ public class Statuspost.remove("noforward");}- if ( post != null && post.size() > 0 ) {+ if ( post != null && !post.isEmpty() ) {if ( sb.adminAuthenticated(header) < 2 ) {prop.authenticationRequired();return prop;diff --git a/htroot/Table_API_p.java b/htroot/Table_API_p.javaindex 062408a84..0e291f300 100644--- a/htroot/Table_API_p.java+++ b/htroot/Table_API_p.java@@ -174,7 +174,7 @@ public class Table_API_p {final Map<String, Integer> l = sb.tables.execAPICalls(Domains.LOCALHOST, (int) sb.getConfigLong("port", 8090), sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, ""), pks);// construct result table- prop.put("showexec", l.size() > 0 ? 1 : 0);+ prop.put("showexec", l.isEmpty() ? 0 : 1);final Iterator<Map.Entry<String, Integer>> resultIterator = l.entrySet().iterator();Map.Entry<String, Integer> record;diff --git a/htroot/yacysearchtrailer.java b/htroot/yacysearchtrailer.javaindex ab1064957..91d09bd67 100644--- a/htroot/yacysearchtrailer.java+++ b/htroot/yacysearchtrailer.java@@ -293,7 +293,7 @@ public class yacysearchtrailer {// vocabulary navigatorsfinal Map<String, ScoreMap<String>> vocabularyNavigators = theSearch.getVocabularyNavigators();- if (vocabularyNavigators != null && vocabularyNavigators.size() > 0) {+ if (vocabularyNavigators != null && !vocabularyNavigators.isEmpty()) {int navvoccount = 0;vocnav: for (Map.Entry<String, ScoreMap<String>> ve: vocabularyNavigators.entrySet()) {String navname = ve.getKey();diff --git a/source/de/anomic/crawler/Balancer.java b/source/de/anomic/crawler/Balancer.javaindex b62ee8d25..aada3b748 100644--- a/source/de/anomic/crawler/Balancer.java+++ b/source/de/anomic/crawler/Balancer.java@@ -504,7 +504,7 @@ public class Balancer {// best case would be, if we have some zeroWaitingCandidates,// then we select that one with the largest stack- if (zeroWaitingCandidates.size() > 0) {+ if (!zeroWaitingCandidates.isEmpty()) {int largestStack = -1;String largestStackHost = null;byte[] largestStackHash = null;@@ -550,7 +550,7 @@ public class Balancer {break;}count++;- if (this.domainStacks.size() > 0 && count > 120 * this.domainStacks.size()) break;+ if (!this.domainStacks.isEmpty() && count > 120 * this.domainStacks.size()) break;}Log.logInfo("BALANCER", "re-fill of domain stacks; fileIndex.size() = " + this.urlFileIndex.size() + ", domainStacks.size = " + this.domainStacks.size() + ", collection time = " + (System.currentTimeMillis() - this.lastDomainStackFill) + " ms");this.domStackInitSize = this.domainStacks.size();diff --git a/source/de/anomic/crawler/CrawlStacker.java b/source/de/anomic/crawler/CrawlStacker.javaindex f21e0b087..1f21fdabf 100644--- a/source/de/anomic/crawler/CrawlStacker.java+++ b/source/de/anomic/crawler/CrawlStacker.java@@ -343,7 +343,7 @@ public final class CrawlStacker {}long maxFileSize = Long.MAX_VALUE;- if (entry.size() > 0) {+ if (!entry.isEmpty()) {final String protocol = entry.url().getProtocol();if (protocol.equals("http") || protocol.equals("https")) maxFileSize = Switchboard.getSwitchboard().getConfigLong("crawler.http.maxFileSize", HTTPLoader.DEFAULT_MAXFILESIZE);if (protocol.equals("ftp")) maxFileSize = Switchboard.getSwitchboard().getConfigLong("crawler.ftp.maxFileSize", FTPLoader.DEFAULT_MAXFILESIZE);diff --git a/source/de/anomic/crawler/retrieval/Request.java b/source/de/anomic/crawler/retrieval/Request.javaindex eb5bf09bd..c0faa20f6 100644--- a/source/de/anomic/crawler/retrieval/Request.java+++ b/source/de/anomic/crawler/retrieval/Request.java@@ -274,6 +274,10 @@ public class Request extends WorkflowJob// the date that the client (browser) send as ifModifiedSince in proxy modereturn this.size;}++ public boolean isEmpty() {+ return this.size == 0;+ }public String name() {// return the anchor name (text inside <a> tag)diff --git a/source/de/anomic/crawler/retrieval/Response.java b/source/de/anomic/crawler/retrieval/Response.javaindex b71bf1eb1..b588e9e14 100644--- a/source/de/anomic/crawler/retrieval/Response.java+++ b/source/de/anomic/crawler/retrieval/Response.java@@ -175,7 +175,7 @@ public class Response {this.requestHeader = new RequestHeader();this.responseHeader = new ResponseHeader(200);this.responseHeader.put(HeaderFramework.CONTENT_TYPE, "text/plain"); // tell parser how to handle the content- if (request.size() > 0) this.responseHeader.put(HeaderFramework.CONTENT_LENGTH, Long.toString(request.size()));+ if (!request.isEmpty()) this.responseHeader.put(HeaderFramework.CONTENT_LENGTH, Long.toString(request.size()));this.profile = profile;this.status = QUEUE_STATE_FRESH;this.content = request.name().length() > 0 ? request.name().getBytes() : request.url().toTokens().getBytes();diff --git a/source/de/anomic/data/BookmarksDB.java b/source/de/anomic/data/BookmarksDB.javaindex 91c68936f..e07d184c2 100644--- a/source/de/anomic/data/BookmarksDB.java+++ b/source/de/anomic/data/BookmarksDB.java@@ -259,10 +259,10 @@ public class BookmarksDB {*/public void putTag(final Tag tag){if (tag == null) return;- if (tag.size() > 0) {- this.tags.put(tag.getTagHash(), tag);- } else {+ if (tag.isEmpty()) {this.tags.remove(tag.getTagHash());+ } else {+ this.tags.put(tag.getTagHash(), tag);}}@@ -461,6 +461,10 @@ public class BookmarksDB {public int size(){return this.urlHashes.size();}++ public boolean isEmpty() {+ return this.urlHashes.isEmpty();+ }}/**diff --git a/source/de/anomic/http/server/HTTPDFileHandler.java b/source/de/anomic/http/server/HTTPDFileHandler.javaindex 0292ba604..9a19b2943 100644--- a/source/de/anomic/http/server/HTTPDFileHandler.java+++ b/source/de/anomic/http/server/HTTPDFileHandler.java@@ -559,7 +559,7 @@ public final class HTTPDFileHandler {// track all files that had been accessed so farif (targetFile != null && targetFile.exists()) {- if (args != null && args.size() > 0) sb.setConfig("server.servlets.submitted", appendPath(sb.getConfig("server.servlets.submitted", ""), path));+ if (args != null && !args.isEmpty()) sb.setConfig("server.servlets.submitted", appendPath(sb.getConfig("server.servlets.submitted", ""), path));}//File targetClass = rewriteClassFile(targetFile);diff --git a/source/net/yacy/ai/example/SchwarzerPeter.java b/source/net/yacy/ai/example/SchwarzerPeter.javaindex 0b883ec43..3dcf732cc 100644--- a/source/net/yacy/ai/example/SchwarzerPeter.java+++ b/source/net/yacy/ai/example/SchwarzerPeter.java@@ -59,7 +59,7 @@ public class SchwarzerPeter {List<Karte> stapel0 = new ArrayList<Karte>();for (Karte karte: alleKarten) stapel0.add(karte);List<Karte> stapel1 = new ArrayList<Karte>();- while (stapel0.size() > 0) stapel1.add(stapel0.remove(r.nextInt(stapel0.size())));+ while (!stapel0.isEmpty()) stapel1.add(stapel0.remove(r.nextInt(stapel0.size())));return stapel1;}@@ -161,7 +161,7 @@ return true;this.haende = new Hand[spieler.spieleranzahl];for (int i = 0; i < spieler.spieleranzahl; i++) this.haende[i] = new Hand(Strategy.nichtsortieren_linksziehen);List<Karte> geben = neuerStapel(r);- while (geben.size() > 0) {+ while (!geben.isEmpty()) {this.haende[spieler.spielernummer].annehmen(r, geben.remove(0));spieler = spieler.nextRole();}diff --git a/source/net/yacy/document/parser/mmParser.java b/source/net/yacy/document/parser/mmParser.javaindex bdf19aff8..cb56d568f 100644--- a/source/net/yacy/document/parser/mmParser.java+++ b/source/net/yacy/document/parser/mmParser.java@@ -83,7 +83,7 @@ public class mmParser extends AbstractParser implements Parser {final List<String> nodeTextList = freeMindHandler.getNodeText();- rootElementText = (nodeTextList.size() > 0) ? nodeTextList.get(0) : "";+ rootElementText = nodeTextList.isEmpty() ? "" : nodeTextList.get(0);for (final String nodeText : nodeTextList) {sb.append(nodeText);diff --git a/source/net/yacy/kelondro/rwi/IndexCell.java b/source/net/yacy/kelondro/rwi/IndexCell.javaindex 50ef4edfb..e46faa545 100644--- a/source/net/yacy/kelondro/rwi/IndexCell.java+++ b/source/net/yacy/kelondro/rwi/IndexCell.java@@ -125,11 +125,11 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBufinal long t = System.currentTimeMillis();if ((IndexCell.this.ram.size() >= IndexCell.this.maxRamEntries ||(IndexCell.this.ram.size() > 3000 && !MemoryControl.request(80L * 1024L * 1024L, false)) ||- (IndexCell.this.ram.size() > 0 && IndexCell.this.lastDump + dumpCycle < t))) {+ (!IndexCell.this.ram.isEmpty() && IndexCell.this.lastDump + dumpCycle < t))) {synchronized (IndexCell.this.merger) {if (IndexCell.this.ram.size() >= IndexCell.this.maxRamEntries ||(IndexCell.this.ram.size() > 3000 && !MemoryControl.request(80L * 1024L * 1024L, false)) ||- (IndexCell.this.ram.size() > 0 && IndexCell.this.lastDump + dumpCycle < t)) try {+ (!IndexCell.this.ram.isEmpty() && IndexCell.this.lastDump + dumpCycle < t)) try {IndexCell.this.lastDump = System.currentTimeMillis();// removed delayedtry {removeDelayed();} catch (final IOException e) {}diff --git a/source/net/yacy/search/index/SolrConfiguration.java b/source/net/yacy/search/index/SolrConfiguration.javaindex 553027ceb..5fc5efe4f 100644--- a/source/net/yacy/search/index/SolrConfiguration.java+++ b/source/net/yacy/search/index/SolrConfiguration.java@@ -108,7 +108,7 @@ public class SolrConfiguration extends ConfigurationSet implements Serializable}protected void addSolr(final SolrDoc solrdoc, final SolrField key, final List<String> value) {- if ((isEmpty() || contains(key.name())) && (!this.lazy || (value != null && value.size() > 0))) solrdoc.addSolr(key, value);+ if ((isEmpty() || contains(key.name())) && (!this.lazy || (value != null && !value.isEmpty()))) solrdoc.addSolr(key, value);}protected void addSolr(final SolrDoc solrdoc, final SolrField key, final int value) {