From 22adb555def3a3153279923f793f902c78d169eb Mon Sep 17 00:00:00 2001 From: borg-0300 Date: Sun, 4 Sep 2005 00:01:09 +0000 Subject: [PATCH] replaced o.compareTo() with o.equals() git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@648 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/ProxyIndexingMonitor_p.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htroot/ProxyIndexingMonitor_p.java b/htroot/ProxyIndexingMonitor_p.java index d16c002ac..a8e282b86 100644 --- a/htroot/ProxyIndexingMonitor_p.java +++ b/htroot/ProxyIndexingMonitor_p.java @@ -83,7 +83,7 @@ public class ProxyIndexingMonitor_p { // read values and put them in global settings int newProxyPrefetchDepth = Integer.parseInt((String) post.get("proxyPrefetchDepth", "0")); if (newProxyPrefetchDepth < 0) newProxyPrefetchDepth = 0; - if (newProxyPrefetchDepth > 25) newProxyPrefetchDepth = 25; // self protection ? + if (newProxyPrefetchDepth > 20) newProxyPrefetchDepth = 20; // self protection ? env.setConfig("proxyPrefetchDepth", Integer.toString(newProxyPrefetchDepth)); boolean proxyStoreHTCache = ((String) post.get("proxyStoreHTCache", "")).equals("on"); env.setConfig("proxyStoreHTCache", (proxyStoreHTCache) ? "true" : "false"); @@ -93,9 +93,11 @@ public class ProxyIndexingMonitor_p { oldProxyCache = env.getConfig("proxyCache", "DATA/HTCACHE"); newProxyCache = ((String) post.get("proxyCache", "DATA/HTCACHE")); newProxyCache = newProxyCache.replace('\\', '/'); - if (newProxyCache.endsWith("/")) newProxyCache.substring(0, newProxyCache.length() - 1); - File cp = new File(newProxyCache); - if ((!cp.isDirectory()) && (!cp.isFile())) cp.mkdirs(); + if (newProxyCache.endsWith("/")) { + newProxyCache.substring(0, newProxyCache.length() - 1); + } + final File cache = new File(newProxyCache); + if ((!cache.isDirectory()) && (!cache.isFile())) cache.mkdirs(); env.setConfig("proxyCache", newProxyCache); // proxyCacheSize @@ -116,7 +118,7 @@ public class ProxyIndexingMonitor_p { prop.put("info_caching", (proxyStoreHTCache) ? 1 : 0); // proxyCache - only display on change - if (oldProxyCache.compareTo(newProxyCache) == 0) { + if (oldProxyCache.equals(newProxyCache)) { prop.put("info_path", 0); prop.put("info_path_return", oldProxyCache); } else { @@ -124,7 +126,7 @@ public class ProxyIndexingMonitor_p { prop.put("info_path_return", newProxyCache); } // proxyCacheSize - only display on change - if (oldProxyCacheSize.compareTo(newProxyCacheSize) == 0) { + if (oldProxyCacheSize.equals(newProxyCacheSize)) { prop.put("info_size", 0); prop.put("info_size_return", oldProxyCacheSize); } else { @@ -134,8 +136,8 @@ public class ProxyIndexingMonitor_p { // proxyCache, proxyCacheSize we need a restart prop.put("info_restart", 0); prop.put("info_restart_return", 0); - if (oldProxyCache.compareTo(newProxyCache) != 0) prop.put("info_restart", 1); - if (oldProxyCacheSize.compareTo(newProxyCacheSize) != 0) prop.put("info_restart", 1); + if (!oldProxyCache.equals(newProxyCache)) prop.put("info_restart", 1); + if (!oldProxyCacheSize.equals(newProxyCacheSize)) prop.put("info_restart", 1); } catch (IOException e) { prop.put("info", 3); //Error: errmsg