mirror of
https://github.com/yacy/yacy_search_server.git
synced 2025-07-18 08:36:07 -04:00
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3436 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
source/de/anomic
@ -50,6 +50,7 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@ -175,10 +176,10 @@ public final class serverCodings {
|
||||
return p;
|
||||
}
|
||||
|
||||
public static HashMap string2map(String string, String separator) {
|
||||
public static Map string2map(String string, String separator) {
|
||||
// this can be used to parse a Map.toString() into a Map again
|
||||
if (string == null) return null;
|
||||
HashMap map = new HashMap();
|
||||
Map map = Collections.synchronizedMap(new HashMap());
|
||||
int pos;
|
||||
if ((pos = string.indexOf("{")) >= 0) string = string.substring(pos + 1).trim();
|
||||
if ((pos = string.lastIndexOf("}")) >= 0) string = string.substring(0, pos).trim();
|
||||
@ -210,7 +211,7 @@ public final class serverCodings {
|
||||
public static Set string2set(String string, String separator) {
|
||||
// this can be used to parse a Map.toString() into a Map again
|
||||
if (string == null) return null;
|
||||
HashSet set = new HashSet();
|
||||
Set set = Collections.synchronizedSet(new HashSet());
|
||||
int pos;
|
||||
if ((pos = string.indexOf("{")) >= 0) string = string.substring(pos + 1).trim();
|
||||
if ((pos = string.lastIndexOf("}")) >= 0) string = string.substring(0, pos).trim();
|
||||
|
@ -64,6 +64,7 @@ import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -164,7 +165,7 @@ public class yacySeed {
|
||||
}
|
||||
|
||||
public yacySeed(String theHash) {
|
||||
this.dna = new HashMap();
|
||||
this.dna = Collections.synchronizedMap(new HashMap());
|
||||
|
||||
// settings that can only be computed by originating peer:
|
||||
// at first startup -
|
||||
@ -616,7 +617,7 @@ public class yacySeed {
|
||||
if (seedStr == null) { return null; }
|
||||
final String seed = crypt.simpleDecode(seedStr, key);
|
||||
if (seed == null) { return null; }
|
||||
final HashMap dna = serverCodings.string2map(seed, ",");
|
||||
final Map dna = serverCodings.string2map(seed, ",");
|
||||
final String hash = (String) dna.remove(yacySeed.HASH);
|
||||
final yacySeed resultSeed = new yacySeed(hash, dna);
|
||||
if (properTest) {
|
||||
|
Reference in New Issue
Block a user