From 69d26045ebdf89b6f82d700cbf67399ca9749a17 Mon Sep 17 00:00:00 2001 From: orbiter Date: Fri, 10 Mar 2006 20:45:14 +0000 Subject: [PATCH] quick-fix for http://www.yacy-forum.de/viewtopic.php?p=18805#18805 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1876 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/kelondro/kelondroMScoreCluster.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/de/anomic/kelondro/kelondroMScoreCluster.java b/source/de/anomic/kelondro/kelondroMScoreCluster.java index 16c0d6581..e67d61e89 100644 --- a/source/de/anomic/kelondro/kelondroMScoreCluster.java +++ b/source/de/anomic/kelondro/kelondroMScoreCluster.java @@ -97,7 +97,7 @@ public final class kelondroMScoreCluster { } // fix out-of-ranges if (l > Integer.MAX_VALUE) return Integer.MAX_VALUE; - if (l < Integer.MIN_VALUE) return Integer.MIN_VALUE; + if (l < 0) return 0; return (int) l; } catch (Exception e) { // try it lex @@ -109,6 +109,8 @@ public final class kelondroMScoreCluster { c += plainByteArray[(byte) s.charAt(i)]; } for (int i = len; i < 5; i++) c <<= 6; + if (c > Integer.MAX_VALUE) return Integer.MAX_VALUE; + if (c < 0) return 0; return c; } }