You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by on...@apache.org on 2016/06/11 11:40:30 UTC

svn commit: r1747881 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java

Author: onealj
Date: Sat Jun 11 11:40:30 2016
New Revision: 1747881

URL: http://svn.apache.org/viewvc?rev=1747881&view=rev
Log:
bug 57840: lazily compute hashCode; patch from Greg Woolsey

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java?rev=1747881&r1=1747880&r2=1747881&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java Sat Jun 11 11:40:30 2016
@@ -62,16 +62,18 @@ final class XSSFEvaluationSheet implemen
     private static class CellKey {
         private final int _row;
         private final int _col;
-        private final int _hash;
+        private int _hash = -1; //lazily computed
         
         protected CellKey(int row, int col) {
             _row = row;
             _col = col;
-            _hash = (17 * 37 + row) * 37 + col;
         }
         
         @Override
         public int hashCode() {
+            if ( _hash == -1 ) {
+                 _hash = (17 * 37 + _row) * 37 + _col;
+            }
             return _hash;
         }
         



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org