Author: j16sdiz
Date: 2009-04-07 05:05:41 +0000 (Tue, 07 Apr 2009)
New Revision: 26590
Modified:
trunk/freenet/src/freenet/support/TimeSortedHashtable.java
Log:
Revert 26588: this is java6 only
Modified: trunk/freenet/src/freenet/support/TimeSortedHashtable.java
===================================================================
--- trunk/freenet/src/freenet/support/TimeSortedHashtable.java 2009-04-07 04:46:10 UTC (rev 26589)
+++ trunk/freenet/src/freenet/support/TimeSortedHashtable.java 2009-04-07 05:05:41 UTC (rev 26590)
@@ -1,6 +1,5 @@
package freenet.support;
-import java.lang.reflect.Array;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
@@ -167,10 +166,9 @@
/**
* @return The set of values after the given time.
*/
+ // FIXME this is broken if timestamp != -1
public final synchronized <E extends Comparable> E[] valuesAfter(long t, E[] values) {
Set<Comparable> s = elements.tailSet(t, false);
- if (values.length != s.size())
- values = (E[]) Array.newInstance(values.getClass().getComponentType(), s.size());
int x = 0;
for(Iterator<Comparable> i = s.iterator();i.hasNext();) {
@@ -202,6 +200,7 @@
assert(elements.size() == valueToElement.size());
}
+ // FIXME this is broken if timestamp != -1
public final synchronized <E extends Comparable> Object[] pairsAfter(long timestamp, E[] valuesArray) {
return new Object[] { valuesAfter(timestamp, valuesArray), timesAfter(timestamp) };
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.