From f0278b4092079a96c1806a88cf1e509281e3d743 Mon Sep 17 00:00:00 2001 From: hermens Date: Fri, 25 Aug 2006 20:23:04 +0000 Subject: [PATCH] Bugfix for / by zero when the AssortmentCluster is empty See: http://www.yacy-forum.de/viewtopic.php?t=2746 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2459 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/plasmaWordIndexAssortmentCluster.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/de/anomic/plasma/plasmaWordIndexAssortmentCluster.java b/source/de/anomic/plasma/plasmaWordIndexAssortmentCluster.java index 3750732a6..373b78378 100644 --- a/source/de/anomic/plasma/plasmaWordIndexAssortmentCluster.java +++ b/source/de/anomic/plasma/plasmaWordIndexAssortmentCluster.java @@ -359,7 +359,7 @@ public final class plasmaWordIndexAssortmentCluster extends indexAbstractRI impl c += assortments[j].size() * assortments[j].cacheObjectChunkSize(); k += assortments[j].size(); } - return (int) (c / k); + return (k > 0) ? (int) (c / k) : 0; } public int[] cacheNodeStatus() {