Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
more PMD enhancements
orbiter82f57f79e55e
diff --git a/htroot/ConfigAppearance_p.java b/htroot/ConfigAppearance_p.javaindex 2440ddf29..8c1882655 100644--- a/htroot/ConfigAppearance_p.java+++ b/htroot/ConfigAppearance_p.java@@ -121,7 +121,7 @@ public class ConfigAppearance_p {return prop;}if (post.containsKey("use_skin") && (post.get("use_skin", "")).equals("on")) {- changeSkin(sb, skinPath, url.substring(url.lastIndexOf("/"), url.length()));+ changeSkin(sb, skinPath, url.substring(url.lastIndexOf('/'), url.length()));}}diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.javaindex 004bc6bf3..95714bf51 100644--- a/htroot/ConfigBasic.java+++ b/htroot/ConfigBasic.java@@ -125,7 +125,7 @@ public class ConfigBasic {String host = null;if (header.containsKey(HeaderFramework.HOST)) {host = header.get(HeaderFramework.HOST);- final int idx = host.indexOf(":");+ final int idx = host.indexOf(':');if (idx != -1) host = host.substring(0,idx);} else {host = Domains.myPublicLocalIP().getHostAddress();diff --git a/htroot/ConfigLanguage_p.java b/htroot/ConfigLanguage_p.javaindex cc2c25d38..efcedf281 100644--- a/htroot/ConfigLanguage_p.java+++ b/htroot/ConfigLanguage_p.java@@ -109,7 +109,7 @@ public class ConfigLanguage_p {return prop;}try{- final File langFile = new File(langPath, url.substring(url.lastIndexOf("/"), url.length()));+ final File langFile = new File(langPath, url.substring(url.lastIndexOf('/'), url.length()));final BufferedWriter bw = new BufferedWriter(new PrintWriter(new FileWriter(langFile)));while (it.hasNext()) {@@ -121,7 +121,7 @@ public class ConfigLanguage_p {return prop;}if(post.containsKey("use_lang") && (post.get("use_lang")).equals("on")){- translator.changeLang(env, langPath, url.substring(url.lastIndexOf("/"), url.length()));+ translator.changeLang(env, langPath, url.substring(url.lastIndexOf('/'), url.length()));}}}diff --git a/htroot/Crawler_p.java b/htroot/Crawler_p.javaindex 83eb53e2e..070150d54 100644--- a/htroot/Crawler_p.java+++ b/htroot/Crawler_p.java@@ -156,7 +156,7 @@ public class Crawler_p {if (crawlingStartURL!= null && fullDomain) {newcrawlingMustMatch = ".*" + crawlingStartURL.getHost() + ".*";}- if (crawlingStart!= null && subPath && (pos = crawlingStart.lastIndexOf("/")) > 0) {+ if (crawlingStart!= null && subPath && (pos = crawlingStart.lastIndexOf('/')) > 0) {newcrawlingMustMatch = crawlingStart.substring(0, pos + 1) + ".*";}diff --git a/htroot/opensearchdescription.java b/htroot/opensearchdescription.javaindex 7ca07d058..97d01fb4c 100644--- a/htroot/opensearchdescription.java+++ b/htroot/opensearchdescription.java@@ -40,7 +40,7 @@ public class opensearchdescription {if (env.getConfigBool(SwitchboardConstants.GREETING_NETWORK_NAME, false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", "");String thisaddress = header.get("Host", "localhost");- if (thisaddress.indexOf(":") == -1) thisaddress += ":" + serverCore.getPortNr(env.getConfig("port", "8080"));+ if (thisaddress.indexOf(':') == -1) thisaddress += ":" + serverCore.getPortNr(env.getConfig("port", "8080"));int compareyacy = 0;if(post != null && post.get("compare_yacy", "false").equals("true"))diff --git a/htroot/processing/domaingraph/applet/domaingraph.java b/htroot/processing/domaingraph/applet/domaingraph.javaindex cf67db7bb..50a27df77 100755--- a/htroot/processing/domaingraph/applet/domaingraph.java+++ b/htroot/processing/domaingraph/applet/domaingraph.java@@ -192,7 +192,7 @@ public HashMap parseProps(String s) {int p;String z;for (int i = 0; i < l.length; i++) {- p = l[i].indexOf("=");+ p = l[i].indexOf('=');if (p > 0) {z = l[i].substring(p + 1).trim();if (z.length() > 0 && z.charAt(0) == '"') z = z.substring(1);diff --git a/htroot/yacy/transferRWI.java b/htroot/yacy/transferRWI.javaindex 4e5ffe52e..a697de7af 100644--- a/htroot/yacy/transferRWI.java+++ b/htroot/yacy/transferRWI.java@@ -153,7 +153,7 @@ public final class transferRWI {estring = it.next();// check if RWI entry is well-formed- p = estring.indexOf("{");+ p = estring.indexOf('{');if ((p < 0) || (estring.indexOf("x=") < 0) || !(estring.indexOf("[B@") < 0)) {blocked++;continue;diff --git a/htroot/yacysearch.java b/htroot/yacysearch.javaindex 88acbbbd3..24d7eead2 100644--- a/htroot/yacysearch.java+++ b/htroot/yacysearch.java@@ -650,7 +650,7 @@ public class yacysearch {// adding some additional properties needed for the rss feedString hostName = header.get("Host", "localhost");- if (hostName.indexOf(":") == -1) hostName += ":" + serverCore.getPortNr(env.getConfig("port", "8080"));+ if (hostName.indexOf(':') == -1) hostName += ":" + serverCore.getPortNr(env.getConfig("port", "8080"));prop.put("searchBaseURL", "http://" + hostName + "/yacysearch.html");prop.put("rssYacyImageURL", "http://" + hostName + "/env/grafics/yacy.gif");}diff --git a/source/de/anomic/crawler/robotsParser.java b/source/de/anomic/crawler/robotsParser.javaindex ce95207ee..dd5dc536b 100644--- a/source/de/anomic/crawler/robotsParser.java+++ b/source/de/anomic/crawler/robotsParser.java@@ -131,7 +131,7 @@ public final class robotsParser {// parse sitemapif (lineUpper.startsWith(ROBOTS_SITEMAP)) {- pos = line.indexOf(" ");+ pos = line.indexOf(' ');if (pos != -1) {sitemap = line.substring(pos).trim();}@@ -160,10 +160,10 @@ public final class robotsParser {if (pos != -1) line = line.substring(0,pos).trim();// getting out the robots name- pos = line.indexOf(" ");+ pos = line.indexOf(' ');if (pos != -1) {final String userAgent = line.substring(pos).trim();- isRule4AllAgents |= userAgent.equals("*");+ isRule4AllAgents |= userAgent.equals('*');isRule4YaCyAgent |= userAgent.toLowerCase().indexOf("yacy") >=0;isRule4YaCyAgent |= userAgent.toLowerCase().indexOf("yacybot") >=0;if (isRule4YaCyAgent) rule4YaCyFound = true;@@ -175,7 +175,7 @@ public final class robotsParser {if (lineUpper.startsWith(ROBOTS_CRAWL_DELAY)) {inBlock = true;if (isRule4YaCyAgent || isRule4AllAgents) {- pos = line.indexOf(" ");+ pos = line.indexOf(' ');if (pos != -1) {try {// the crawl delay can be a float number and means number of seconds@@ -202,7 +202,7 @@ public final class robotsParser {if (line.endsWith("*")) line = line.substring(0,line.length()-1);// parse the path- pos = line.indexOf(" ");+ pos = line.indexOf(' ');if (pos >= 0) {// getting the pathString path = line.substring(pos).trim();diff --git a/source/de/anomic/http/server/HTTPDFileHandler.java b/source/de/anomic/http/server/HTTPDFileHandler.javaindex c83023aeb..90ff0ce69 100644--- a/source/de/anomic/http/server/HTTPDFileHandler.java+++ b/source/de/anomic/http/server/HTTPDFileHandler.java@@ -405,8 +405,8 @@ public final class HTTPDFileHandler {// the indexOf(".") is just a workaround because there from ConfigLanguage.html commes "de.lng" and// from ConfigBasic.html comes just "de" in the "language" parameterlocaleSelection = args.get("language", localeSelection);- if (localeSelection.indexOf(".") != -1)- localeSelection = localeSelection.substring(0, localeSelection.indexOf("."));+ if (localeSelection.indexOf('.') != -1)+ localeSelection = localeSelection.substring(0, localeSelection.indexOf('.'));}File targetFile = getLocalizedFile(path, localeSelection);@@ -655,7 +655,7 @@ public final class HTTPDFileHandler {String key;String value;for (int i = 0; i < cgiHeader.length; i++) {- indexOfDelimiter = cgiHeader[i].indexOf(":");+ indexOfDelimiter = cgiHeader[i].indexOf(':');key = cgiHeader[i].substring(0, indexOfDelimiter).trim();value = cgiHeader[i].substring(indexOfDelimiter + 1).trim();conProp.setProperty(key, value);@@ -1110,7 +1110,7 @@ public final class HTTPDFileHandler {private static final File rewriteClassFile(final File template) {try {String f = template.getCanonicalPath();- final int p = f.lastIndexOf(".");+ final int p = f.lastIndexOf('.');if (p < 0) return null;f = f.substring(0, p) + ".class";//System.out.println("constructed class path " + f);diff --git a/source/de/anomic/http/server/HTTPDProxyHandler.java b/source/de/anomic/http/server/HTTPDProxyHandler.javaindex b4493e2e5..3b4cdf3d0 100644--- a/source/de/anomic/http/server/HTTPDProxyHandler.java+++ b/source/de/anomic/http/server/HTTPDProxyHandler.java@@ -332,7 +332,7 @@ public final class HTTPDProxyHandler {return;}- if ((pos = host.indexOf(":")) < 0) {+ if ((pos = host.indexOf(':')) < 0) {port = 80;} else {port = Integer.parseInt(host.substring(pos + 1));@@ -451,7 +451,7 @@ public final class HTTPDProxyHandler {final String httpVer = conProp.getProperty(HeaderFramework.CONNECTION_PROP_HTTP_VER); // the ip from the connecting peerint port, pos;- if ((pos = host.indexOf(":")) < 0) {+ if ((pos = host.indexOf(':')) < 0) {port = 80;} else {port = Integer.parseInt(host.substring(pos + 1));@@ -762,7 +762,7 @@ public final class HTTPDProxyHandler {final String httpVer = conProp.getProperty(HeaderFramework.CONNECTION_PROP_HTTP_VER);int port, pos;- if ((pos = host.indexOf(":")) < 0) {+ if ((pos = host.indexOf(':')) < 0) {port = 80;} else {port = Integer.parseInt(host.substring(pos + 1));@@ -865,7 +865,7 @@ public final class HTTPDProxyHandler {final String httpVer = conProp.getProperty(HeaderFramework.CONNECTION_PROP_HTTP_VER);int port, pos;- if ((pos = host.indexOf(":")) < 0) {+ if ((pos = host.indexOf(':')) < 0) {port = 80;} else {port = Integer.parseInt(host.substring(pos + 1));@@ -1049,11 +1049,11 @@ public final class HTTPDProxyHandler {private static String domain(final String host) {String domain = host;- int pos = domain.lastIndexOf(".");+ int pos = domain.lastIndexOf('.');if (pos >= 0) {// truncate from last partdomain = domain.substring(0, pos);- pos = domain.lastIndexOf(".");+ pos = domain.lastIndexOf('.');if (pos >= 0) {// truncate from first partdomain = domain.substring(pos + 1);@@ -1224,7 +1224,7 @@ public final class HTTPDProxyHandler {if (args != null) { path = path + "?" + args; }int port, pos;- if ((pos = host.indexOf(":")) < 0) {+ if ((pos = host.indexOf(':')) < 0) {port = 80;} else {port = Integer.parseInt(host.substring(pos + 1));@@ -1503,7 +1503,7 @@ public final class HTTPDProxyHandler {// getting some connection propertiesString orgHostPort = "80";String orgHostName = conProp.getProperty(HeaderFramework.CONNECTION_PROP_HOST,"unknown").toLowerCase();- int pos = orgHostName.indexOf(":");+ int pos = orgHostName.indexOf(':');if (pos != -1) {orgHostPort = orgHostName.substring(pos+1);orgHostName = orgHostName.substring(0,pos);@@ -1531,7 +1531,7 @@ public final class HTTPDProxyHandler {if (addr != null) if (addr != null) testHostNames.add(testHostName);}- pos = orgHostName.lastIndexOf(".");+ pos = orgHostName.lastIndexOf('.');if (pos != -1) {final Iterator<String> iter = topLevelDomains.iterator();while (iter.hasNext()) {@@ -1661,8 +1661,8 @@ public final class HTTPDProxyHandler {if (conProp.containsKey(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_HEADER)) {final HeaderFramework proxyRespondHeader = (HeaderFramework) conProp.get(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_HEADER);mime = proxyRespondHeader.mime();- if (mime.indexOf(";") != -1) {- mime = mime.substring(0,mime.indexOf(";"));+ if (mime.indexOf(';') != -1) {+ mime = mime.substring(0,mime.indexOf(';'));}}logMessage.append(mime);diff --git a/source/de/anomic/http/server/HTTPDemon.java b/source/de/anomic/http/server/HTTPDemon.javaindex 57b263d73..d543ba7be 100644--- a/source/de/anomic/http/server/HTTPDemon.java+++ b/source/de/anomic/http/server/HTTPDemon.java@@ -348,7 +348,7 @@ public final class HTTPDemon implements serverHandler, Cloneable {final String host = this.prop.getProperty(HeaderFramework.CONNECTION_PROP_HOST);if (host == null) return false;int pos;- if ((pos = host.indexOf(":")) < 0) {+ if ((pos = host.indexOf(':')) < 0) {// default port 80return false; // not allowed}@@ -439,7 +439,7 @@ public final class HTTPDemon implements serverHandler, Cloneable {int pos;String unknownCommand = null, args = null;- if ((pos = requestLine.indexOf(" ")) > 0) {+ if ((pos = requestLine.indexOf(' ')) > 0) {unknownCommand = requestLine.substring(0,pos);args = requestLine.substring(pos+1);} else {@@ -660,7 +660,7 @@ public final class HTTPDemon implements serverHandler, Cloneable {// this is to support https// parse HTTP version- int pos = arg.indexOf(" ");+ int pos = arg.indexOf(' ');String httpVersion = "HTTP/1.0";if (pos >= 0) {httpVersion = arg.substring(pos + 1);@@ -670,7 +670,7 @@ public final class HTTPDemon implements serverHandler, Cloneable {// parse hostname and portprop.setProperty(HeaderFramework.CONNECTION_PROP_HOST, arg);- pos = arg.indexOf(":");+ pos = arg.indexOf(':');int port = 443;if (pos >= 0) {port = Integer.parseInt(arg.substring(pos + 1));@@ -773,8 +773,8 @@ public final class HTTPDemon implements serverHandler, Cloneable {int argc = 0;// Textfield1=default+value+Textfield+1&Textfield2=default+value+Textfield+2&selection1=sel1&selection2=othervalue1&selection2=sel2&selection3=sel3&Menu1=SubEnry11&radio1=button1&check1=button2&check1=button3&hidden1=&sButton1=enter+%281%29while (argsString.length() > 0) {- eqp = argsString.indexOf("=");- sep = argsString.indexOf("&");+ eqp = argsString.indexOf('=');+ sep = argsString.indexOf('&');if ((eqp <= 0) || (sep <= 0)) break;// resulting equations are inserted into the property args with leading '&'args.put(parseArg(argsString.substring(0, eqp)), parseArg(argsString.substring(eqp + 1, sep)));@@ -1127,7 +1127,7 @@ public final class HTTPDemon implements serverHandler, Cloneable {final String method = conProp.getProperty(HeaderFramework.CONNECTION_PROP_METHOD);int port = 80;- final int pos = host.indexOf(":");+ final int pos = host.indexOf(':');if (pos != -1) {port = Integer.parseInt(host.substring(pos + 1));host = host.substring(0, pos);@@ -1414,7 +1414,7 @@ public final class HTTPDemon implements serverHandler, Cloneable {if ((path == null) || (path.length() == 0)) return true;int pos;- if ((pos = path.lastIndexOf(".")) != -1) {+ if ((pos = path.lastIndexOf('.')) != -1) {return !disallowZippedContentEncoding.contains(path.substring(pos).toLowerCase());}return true;@@ -1477,7 +1477,7 @@ public final class HTTPDemon implements serverHandler, Cloneable {if ((hostName == null) || (hostName.length() == 0)) return false;try {- final int idx = hostName.indexOf(":");+ final int idx = hostName.indexOf(':');final String dstHost = (idx != -1) ? hostName.substring(0,idx).trim() : hostName.trim();final Integer dstPort = (idx != -1) ? Integer.valueOf(hostName.substring(idx+1).trim()) : Integer.valueOf(80);diff --git a/source/de/anomic/http/server/HeaderFramework.java b/source/de/anomic/http/server/HeaderFramework.javaindex db0625a34..57d34ce94 100644--- a/source/de/anomic/http/server/HeaderFramework.java+++ b/source/de/anomic/http/server/HeaderFramework.java@@ -468,7 +468,7 @@ public class HeaderFramework extends TreeMap<String, String> implements Map<Stri//String ip = conProp.getProperty(httpHeader.CONNECTION_PROP_CLIENTIP); // the ip from the connecting peerint port, pos;- if ((pos = host.indexOf(":")) < 0) {+ if ((pos = host.indexOf(':')) < 0) {port = 80;} else {port = Integer.parseInt(host.substring(pos + 1));@@ -508,7 +508,7 @@ public class HeaderFramework extends TreeMap<String, String> implements Map<StriString line;while ((line = reader.readLine()) != null) {if (line.length() == 0) break;- if ((p = line.indexOf(":")) >= 0) {+ if ((p = line.indexOf(':')) >= 0) {// store a propertyadd(line.substring(0, p).trim(), line.substring(p + 1).trim());}diff --git a/source/de/anomic/net/natLib.java b/source/de/anomic/net/natLib.javaindex f3f0b8e46..ec82fbf49 100644--- a/source/de/anomic/net/natLib.java+++ b/source/de/anomic/net/natLib.java@@ -67,7 +67,7 @@ public class natLib {}}if (ip == null) return false;- if (ip.indexOf(":") >= 0) return false; // ipv6...+ if (ip.indexOf(':') >= 0) return false; // ipv6...return (isNotLocal(ip)) && (isIP(ip));}diff --git a/source/de/anomic/search/RankingProfile.java b/source/de/anomic/search/RankingProfile.javaindex 6124a2d30..fae6700ed 100644--- a/source/de/anomic/search/RankingProfile.java+++ b/source/de/anomic/search/RankingProfile.java@@ -130,7 +130,7 @@ public class RankingProfile {for (int i = 0; i < elts.length; i++) {e = elts[i].trim();if ((s == 0) || (e.startsWith(prefix))) {- p = e.indexOf("=");+ p = e.indexOf('=');if (p < 0) System.out.println("DEBUG: bug in plasmaSearchRankingProfile: e = " + e);if ((p > 0) && (e.length() > p + 1)) coeff.put(e.substring(s, p), Integer.valueOf(Integer.parseInt(e.substring(p + 1))));}diff --git a/source/de/anomic/server/serverCore.java b/source/de/anomic/server/serverCore.javaindex f23154ded..631d3eb85 100644--- a/source/de/anomic/server/serverCore.java+++ b/source/de/anomic/server/serverCore.java@@ -243,7 +243,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {public static int getPortNr(String extendedPortString) {int pos = -1;- if ((pos = extendedPortString.indexOf(":"))!= -1) {+ if ((pos = extendedPortString.indexOf(':'))!= -1) {extendedPortString = extendedPortString.substring(pos+1);}return Integer.parseInt(extendedPortString);@@ -256,7 +256,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {int bindPort;int pos = -1;- if ((pos = extendedPortString.indexOf(":"))!= -1) {+ if ((pos = extendedPortString.indexOf(':'))!= -1) {bindIP = extendedPortString.substring(0,pos).trim();extendedPortString = extendedPortString.substring(pos+1);diff --git a/source/de/anomic/server/serverSwitch.java b/source/de/anomic/server/serverSwitch.javaindex bcffeb790..319daa9f8 100644--- a/source/de/anomic/server/serverSwitch.java+++ b/source/de/anomic/server/serverSwitch.java@@ -490,7 +490,7 @@ public class serverSwitch {// read user name according to host addressesfinal String a = authorization.get(host);if (a == null) return null;- final int p = a.indexOf("@");+ final int p = a.indexOf('@');if (p < 0) return null;return a.substring(0, p);}@@ -499,7 +499,7 @@ public class serverSwitch {// read access rigths according to host addressesfinal String a = authorization.get(host);if (a == null) return null;- final int p = a.indexOf("@");+ final int p = a.indexOf('@');if (p < 0) return null;return a.substring(p + 1);}diff --git a/source/de/anomic/yacy/yacySeedDB.java b/source/de/anomic/yacy/yacySeedDB.javaindex 47dc2d82d..260ae8743 100644--- a/source/de/anomic/yacy/yacySeedDB.java+++ b/source/de/anomic/yacy/yacySeedDB.java@@ -608,7 +608,7 @@ public final class yacySeedDB implements AlternativeDomainNames {badPeerHashes.add(seed.hash);continue;}- if ((pos = addressStr.indexOf(":"))!= -1) {+ if ((pos = addressStr.indexOf(':'))!= -1) {addressStr = addressStr.substring(0,pos);}seedIPAddress = InetAddress.getByName(addressStr);@@ -637,7 +637,7 @@ public final class yacySeedDB implements AlternativeDomainNames {badPeerHashes.add(seed.hash);continue;}- if ((pos = addressStr.indexOf(":"))!= -1) {+ if ((pos = addressStr.indexOf(':'))!= -1) {addressStr = addressStr.substring(0,pos);}seedIPAddress = InetAddress.getByName(addressStr);@@ -660,7 +660,7 @@ public final class yacySeedDB implements AlternativeDomainNames {try {seed = e.next();if ((seed != null) && ((addressStr = seed.getPublicAddress()) != null)) {- if ((pos = addressStr.indexOf(":"))!= -1) {+ if ((pos = addressStr.indexOf(':'))!= -1) {addressStr = addressStr.substring(0,pos);}seedIPAddress = InetAddress.getByName(addressStr);@@ -676,7 +676,7 @@ public final class yacySeedDB implements AlternativeDomainNames {if (this.mySeed == null) return null;addressStr = mySeed.getPublicAddress();if (addressStr == null) return null;- if ((pos = addressStr.indexOf(":"))!= -1) {+ if ((pos = addressStr.indexOf(':'))!= -1) {addressStr = addressStr.substring(0,pos);}seedIPAddress = InetAddress.getByName(addressStr);@@ -837,7 +837,7 @@ public final class yacySeedDB implements AlternativeDomainNames {if (host.endsWith(".yacyh")) {// this is not functional at the moment// caused by lowecasing of hashes at the browser client- p = host.indexOf(".");+ p = host.indexOf('.');if ((p > 0) && (p != (host.length() - 6))) {subdom = host.substring(0, p);host = host.substring(p + 1);@@ -860,7 +860,7 @@ public final class yacySeedDB implements AlternativeDomainNames {return seed.getPublicAddress() + ((subdom == null) ? "" : ("/" + subdom));} else if (host.endsWith(".yacy")) {// identify subdomain- p = host.indexOf(".");+ p = host.indexOf('.');if ((p > 0) && (p != (host.length() - 5))) {subdom = host.substring(0, p); // no double-dot attack possible, the subdom cannot have ".." in ithost = host.substring(p + 1); // if ever, the double-dots are here but do not harmdiff --git a/source/net/sbbi/upnp/HttpResponse.java b/source/net/sbbi/upnp/HttpResponse.javaindex dbcd20534..76235abec 100644--- a/source/net/sbbi/upnp/HttpResponse.java+++ b/source/net/sbbi/upnp/HttpResponse.java@@ -70,7 +70,8 @@ public class HttpResponse {* @throws IllegalArgumentException if some error occurs during parsing*/protected HttpResponse( String rawHttpResponse ) throws IllegalArgumentException {- if ( rawHttpResponse == null || rawHttpResponse.trim().length() == 0 ) {+ rawHttpResponse = rawHttpResponse.trim();+ if ( rawHttpResponse == null || rawHttpResponse.length() == 0 ) {throw new IllegalArgumentException( "Empty HTTP response message" );}boolean bodyParsing = false;@@ -123,7 +124,7 @@ public class HttpResponse {while (tokenizer.countTokens() > 0) {String nextToken = tokenizer.nextToken().trim();if ( nextToken.startsWith( elementName ) ) {- int index = nextToken.indexOf( "=" );+ int index = nextToken.indexOf( '=' );if ( index != -1 ) {return nextToken.substring( index + 1 ).trim();}diff --git a/source/net/yacy/document/Document.java b/source/net/yacy/document/Document.javaindex 932c8eeab..911429fac 100644--- a/source/net/yacy/document/Document.java+++ b/source/net/yacy/document/Document.java@@ -376,9 +376,9 @@ dc_rightsif (u.startsWith("mailto:")) {emaillinks.put(u.substring(7), entry.getValue());} else {- extpos = u.lastIndexOf(".");+ extpos = u.lastIndexOf('.');if (extpos > 0) {- if (((qpos = u.indexOf("?")) >= 0) && (qpos > extpos)) {+ if (((qpos = u.indexOf('?')) >= 0) && (qpos > extpos)) {ext = u.substring(extpos + 1, qpos).toLowerCase();} else {ext = u.substring(extpos + 1).toLowerCase();diff --git a/source/net/yacy/kelondro/data/meta/DigestURI.java b/source/net/yacy/kelondro/data/meta/DigestURI.javaindex 2d94881f1..4ce7dbc65 100644--- a/source/net/yacy/kelondro/data/meta/DigestURI.java+++ b/source/net/yacy/kelondro/data/meta/DigestURI.java@@ -935,7 +935,7 @@ public class DigestURI implements Serializable {public final String language() {String language = "en";if (host == null) return language;- final int pos = host.lastIndexOf(".");+ final int pos = host.lastIndexOf('.');if (pos > 0 && host.length() - pos == 3) language = host.substring(pos + 1).toLowerCase();if (language.equals("uk")) language = "en";return language;