From 01b3e9431ad24cb4412a2eb7e19b0c213b233d13 Mon Sep 17 00:00:00 2001 From: orbiter Date: Sat, 24 May 2008 11:30:16 +0000 Subject: [PATCH] - fix for http://forum.yacy-websuche.de/viewtopic.php?f=6&t=1140&p=7626#p7626 - less dots for ppm bar in watchcrawler (one dot for each 10 ppm) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4846 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- build.properties | 2 +- htroot/js/WatchCrawler.js | 2 +- htroot/yacy/hello.java | 8 ++++++-- source/de/anomic/server/serverCodings.java | 20 ++++++++++++++++---- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/build.properties b/build.properties index 1278199c4..a0344e219 100644 --- a/build.properties +++ b/build.properties @@ -3,7 +3,7 @@ javacSource=1.5 javacTarget=1.5 # Release Configuration -releaseVersion=0.585 +releaseVersion=0.586 stdReleaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz embReleaseFile=yacy_emb_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz proReleaseFile=yacy_pro_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz diff --git a/htroot/js/WatchCrawler.js b/htroot/js/WatchCrawler.js index 96f9d4691..3f205c025 100644 --- a/htroot/js/WatchCrawler.js +++ b/htroot/js/WatchCrawler.js @@ -72,7 +72,7 @@ function handleStatus(){ var ppmSpan = document.getElementById("ppmSpan"); removeAllChildren(ppmSpan); - for(i=0;i si = ySeeds.values().iterator(); yacySeed s; + String seedString; while (si.hasNext()) { s = si.next(); if ((s != null) && (s.isProper() == null)) try { - seeds.append("seed").append(count).append('=').append(s.genSeedStr(key)).append(serverCore.CRLF_STRING); - count++; + seedString = s.genSeedStr(key); + if (seedString != null) { + seeds.append("seed").append(count).append('=').append(seedString).append(serverCore.CRLF_STRING); + count++; + } } catch (ConcurrentModificationException e) { e.printStackTrace(); } diff --git a/source/de/anomic/server/serverCodings.java b/source/de/anomic/server/serverCodings.java index a6320b045..db704a7aa 100644 --- a/source/de/anomic/server/serverCodings.java +++ b/source/de/anomic/server/serverCodings.java @@ -51,6 +51,7 @@ import java.io.FileInputStream; import java.io.InputStream; import java.security.MessageDigest; import java.util.Collections; +import java.util.ConcurrentModificationException; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -199,10 +200,21 @@ public final class serverCodings { synchronized (m) { final StringBuffer buf = new StringBuffer(20 * m.size()); if (braces) { buf.append("{"); } - for (Entry e: m.entrySet()) { - buf.append(e.getKey()).append('='); - if (e.getValue() != null) { buf.append(e.getValue()); } - buf.append(separator); + int retry = 10; + critical: while (retry > 0) { + try { + for (Entry e: m.entrySet()) { + buf.append(e.getKey()).append('='); + if (e.getValue() != null) { buf.append(e.getValue()); } + buf.append(separator); + } + break critical; // success + } catch (ConcurrentModificationException e) { + // retry + buf.setLength(1); + retry--; + } + buf.setLength(1); // fail } if (buf.length() > 1) { buf.setLength(buf.length() - 1); } // remove last separator if (braces) { buf.append("}"); }