Skip to content

Commit

Permalink
fix for fixes from this afternoon
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6253 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Aug 7, 2009
1 parent cf739ed commit 8e56c2a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion source/de/anomic/crawler/retrieval/LoaderDispatcher.java
Expand Up @@ -109,7 +109,7 @@ public Request request(
final yacyURL url,
final boolean forText,
final boolean global
) throws IOException {
) {
return new Request(
sb.peers.mySeed().hash,
url,
Expand Down
12 changes: 7 additions & 5 deletions source/de/anomic/kelondro/blob/MapView.java
Expand Up @@ -135,14 +135,16 @@ private static Map<String, String> string2map(final String s) throws IOException
* @throws IOException
*/
public void put(String key, final Map<String, String> newMap) throws IOException {
assert (key != null);
assert (key.length() > 0);
assert (newMap != null);
assert key != null;
assert key.length() > 0;
assert newMap != null;
key = normalizeKey(key);

assert blob != null;
synchronized (this) {
// write entry
blob.put(key.getBytes("UTF-8"), map2string(newMap, "W" + DateFormatter.formatShortSecond() + " ").getBytes("UTF-8"));
String s = map2string(newMap, "W" + DateFormatter.formatShortSecond() + " ");
assert s != null;
blob.put(key.getBytes("UTF-8"), s.getBytes("UTF-8"));

// write map to cache
cache.put(key, newMap);
Expand Down
14 changes: 8 additions & 6 deletions source/de/anomic/kelondro/index/SimpleARC.java
Expand Up @@ -62,16 +62,18 @@ public SimpleARC(int cacheSize) {
}

/**
* put a value to the cache. The value may NOT exist before.
* This restriction is used here to check possible algorithm logic error cases.
* put a value to the cache.
* @param s
* @param v
*/
public void put(K s, V v) {
assert this.levelA.get(s) == null;
assert this.levelB.get(s) == null;
this.levelA.put(s, v);
assert (this.levelA.size() <= cacheSize); // the cache should shrink automatically
if (this.levelB.containsKey(s)) {
this.levelB.put(s, v);
assert (this.levelB.size() <= cacheSize); // the cache should shrink automatically
} else {
this.levelA.put(s, v);
assert (this.levelA.size() <= cacheSize); // the cache should shrink automatically
}
}

/**
Expand Down

0 comments on commit 8e56c2a

Please sign in to comment.