Skip to content

Commit

Permalink
fix for ConcurrentModificationException
Browse files Browse the repository at this point in the history
  • Loading branch information
orbiter committed Jun 6, 2007
1 parent 4fca11f commit 4ca7974
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions source/de/anomic/plasma/plasmaWebStructure.java
Expand Up @@ -29,6 +29,7 @@

import java.io.File;
import java.io.IOException;
import java.util.ConcurrentModificationException;
import java.util.Date;
import java.util.Iterator;
import java.util.Map;
Expand Down Expand Up @@ -222,12 +223,19 @@ public int referencesCount(String domhash) {
public String resolveDomHash2DomString(String domhash) {
// returns the domain as string, null if unknown
assert domhash.length() == 6;
SortedMap tailMap = structure.tailMap(domhash);
if ((tailMap == null) || (tailMap.size() == 0)) return null;
String key = (String) tailMap.firstKey();
if (key.startsWith(domhash)) {
return key.substring(7);
} else {
try {
SortedMap tailMap = structure.tailMap(domhash);
if ((tailMap == null) || (tailMap.size() == 0)) return null;
String key = (String) tailMap.firstKey();
if (key.startsWith(domhash)) {
return key.substring(7);
} else {
return null;
}
} catch (ConcurrentModificationException e) {
// we dont want to implement a synchronization here,
// because this is 'only' used for a graphics application
// just return null
return null;
}
}
Expand Down

0 comments on commit 4ca7974

Please sign in to comment.