diff --git a/htroot/ViewProfile.java b/htroot/ViewProfile.java index 3117236a5..e2e8676b2 100644 --- a/htroot/ViewProfile.java +++ b/htroot/ViewProfile.java @@ -103,8 +103,8 @@ public class ViewProfile { } else { // read the profile from remote peer yacySeed seed = yacyCore.seedDB.getConnected(hash); - if (seed == null) { - seed = yacyCore.seedDB.getDisconnected(hash); + if (seed == null) seed = yacyCore.seedDB.getDisconnected(hash); + if (seed != null) { long lastseen = Math.abs((System.currentTimeMillis() - seed.getLastSeenTime()) / 1000 / 60); if (lastseen > 120) seed = null; // if contact is too old, we treat it as disconnected } diff --git a/source/de/anomic/kelondro/kelondroRowBufferedSet.java b/source/de/anomic/kelondro/kelondroRowBufferedSet.java index 9e4667aed..b97f7dda1 100644 --- a/source/de/anomic/kelondro/kelondroRowBufferedSet.java +++ b/source/de/anomic/kelondro/kelondroRowBufferedSet.java @@ -26,6 +26,7 @@ package de.anomic.kelondro; import java.util.Map; import java.util.Iterator; +import java.util.NoSuchElementException; import java.util.TreeMap; import de.anomic.server.serverMemory; @@ -73,10 +74,10 @@ public class kelondroRowBufferedSet extends kelondroRowSet { synchronized (buffer) { if (buffer.size() == 0) { super.removeOne(); - } else { + } else try { //buffer.remove(buffer.keySet().iterator().next()); buffer.remove(buffer.lastKey()); - } + } catch (NoSuchElementException e) {} } } diff --git a/source/de/anomic/plasma/plasmaSwitchboardQueue.java b/source/de/anomic/plasma/plasmaSwitchboardQueue.java index 4434294d0..2fef55943 100644 --- a/source/de/anomic/plasma/plasmaSwitchboardQueue.java +++ b/source/de/anomic/plasma/plasmaSwitchboardQueue.java @@ -149,8 +149,10 @@ public class plasmaSwitchboardQueue { if ((index < 0) || (index >= sbQueueStack.size())) throw new ArrayIndexOutOfBoundsException(); try { ArrayList list = sbQueueStack.botList(index); + kelondroRow.Entry entry; for (int i = 0; i < list.size(); i++) { - list.set(i, new Entry((kelondroRow.Entry) list.get(i))); + entry = (kelondroRow.Entry) list.get(i); + list.set(i, (entry == null) ? null : new Entry(entry)); } return list; } catch (kelondroException e) {