From: Nick Burch Date: Fri, 27 May 2011 11:45:50 +0000 (+0000) Subject: Fix bug #51273 - Hash codes can be negative when working on our own low memory hash... X-Git-Tag: REL_3_8_BETA3~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=044c992853a25bf64f5a43453c136a660cc02ff2;p=poi.git Fix bug #51273 - Hash codes can be negative when working on our own low memory hash for formula cell evaluation git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1128268 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index c0790c9f33..5da84b934b 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 51273 - Formula Value Cache fix for repeated evaluations 51171 - Improved performance of SharedValueManager 51236 - XSSF set colour support for black/white to match getter 51196 - Initial support for Spreadsheet Chart API diff --git a/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntrySet.java b/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntrySet.java index d8e573150e..9a40cbc95e 100644 --- a/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntrySet.java +++ b/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntrySet.java @@ -76,8 +76,7 @@ final class FormulaCellCacheEntrySet { private static boolean addInternal(CellCacheEntry[] arr, CellCacheEntry cce) { - - int startIx = cce.hashCode() % arr.length; + int startIx = Math.abs(cce.hashCode() % arr.length); for(int i=startIx; i