diff --git a/source/net/yacy/cora/ranking/Rating.java b/source/net/yacy/cora/ranking/Rating.java index e1a1c67f2..6b8fc80c7 100644 --- a/source/net/yacy/cora/ranking/Rating.java +++ b/source/net/yacy/cora/ranking/Rating.java @@ -48,19 +48,8 @@ public class Rating { return this.object; } - @SuppressWarnings("rawtypes") - public final static ObjectComparator objectComparator = new ObjectComparator(); public final static ScoreComparator scoreComparator = new ScoreComparator(); - public static class ObjectComparator implements Comparator> { - - @SuppressWarnings("unchecked") - public int compare(final Rating arg0, final Rating arg1) { - if (!(arg0 instanceof Comparable)) throw new UnsupportedOperationException("object class must implement comparable"); - return ((Comparable) arg0.getObject()).compareTo(arg1.getObject()); - } - } - public static class ScoreComparator implements Comparator> { public int compare(final Rating arg0, final Rating arg1) { diff --git a/source/net/yacy/kelondro/rwi/IndexCell.java b/source/net/yacy/kelondro/rwi/IndexCell.java index de48ee3fc..0f80d1b32 100644 --- a/source/net/yacy/kelondro/rwi/IndexCell.java +++ b/source/net/yacy/kelondro/rwi/IndexCell.java @@ -34,7 +34,6 @@ import java.util.TreeMap; import net.yacy.cora.ranking.Order; import net.yacy.cora.ranking.Rating; -import net.yacy.cora.ranking.RatingOrder; import net.yacy.cora.storage.ComparableARC; import net.yacy.kelondro.data.meta.URIMetadataRow; import net.yacy.kelondro.index.HandleSet; @@ -453,19 +452,7 @@ public final class IndexCell extends AbstractBu } public CloneableIterator> referenceCountIterator(final byte[] starttermHash, final boolean rot) { - final RatingOrder containerOrder = new RatingOrder(this.ram.rowdef().getOrdering()); - containerOrder.rotate(new Rating(starttermHash, 0)); - return new MergeIterator>( - this.ram.referenceCountIterator(starttermHash, rot), - new MergeIterator>( - this.ram.referenceCountIterator(starttermHash, false), - this.array.referenceCountIterator(starttermHash, false), - containerOrder, - ReferenceContainer.containerMergeMethod, - true), - containerOrder, - ReferenceContainer.containerMergeMethod, - true); + return this.array.referenceCountIterator(starttermHash, false); } public CloneableIterator> referenceContainerIterator(final byte[] starttermHash, final boolean rot) { diff --git a/source/net/yacy/kelondro/rwi/ReferenceContainer.java b/source/net/yacy/kelondro/rwi/ReferenceContainer.java index 725cfaca5..0e5b2b06f 100644 --- a/source/net/yacy/kelondro/rwi/ReferenceContainer.java +++ b/source/net/yacy/kelondro/rwi/ReferenceContainer.java @@ -216,9 +216,12 @@ public class ReferenceContainer extends RowSet } public static Object mergeUnique(final Object a, final Object b) throws RowSpaceExceededException { - final ReferenceContainer c = (ReferenceContainer) a; - c.addAllUnique((ReferenceContainer) b); - return c; + if (a instanceof ReferenceContainer) { + final ReferenceContainer c = (ReferenceContainer) a; + c.addAllUnique((ReferenceContainer) b); + return c; + } + throw new UnsupportedOperationException("Objects have wrong type: " + a.getClass().getName()); } public static final Method containerMergeMethod; diff --git a/source/net/yacy/kelondro/rwi/ReferenceContainerCache.java b/source/net/yacy/kelondro/rwi/ReferenceContainerCache.java index 95dd7bf3b..92dff501d 100644 --- a/source/net/yacy/kelondro/rwi/ReferenceContainerCache.java +++ b/source/net/yacy/kelondro/rwi/ReferenceContainerCache.java @@ -185,7 +185,6 @@ public final class ReferenceContainerCache exte if (entry.getValue() != null && entry.getValue().getTermHash() != null) list.add(new Rating(entry.getKey(), entry.getValue().size())); } } - Collections.sort(list, new Rating.ObjectComparator()); return list; }