From 044c992853a25bf64f5a43453c136a660cc02ff2 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 27 May 2011 11:45:50 +0000 Subject: 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 --- src/documentation/content/xdocs/status.xml | 1 + src/java/org/apache/poi/ss/formula/FormulaCellCacheEntrySet.java | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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