lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r734415 - /lucene/java/trunk/src/java/org/apache/lucene/index/SegmentMerger.java
Date Wed, 14 Jan 2009 15:10:18 GMT
Author: mikemccand
Date: Wed Jan 14 07:09:57 2009
New Revision: 734415

URL: http://svn.apache.org/viewvc?rev=734415&view=rev
Log:
LUCENE-1519: upcast to long to prevent overflow

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentMerger.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentMerger.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentMerger.java?rev=734415&r1=734414&r2=734415&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentMerger.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentMerger.java Wed Jan 14 07:09:57
2009
@@ -374,7 +374,7 @@
 
       final long fdxFileLength = directory.fileLength(segment + "." + IndexFileNames.FIELDS_INDEX_EXTENSION);
 
-      if (4+docCount*8 != fdxFileLength)
+      if (4+((long) docCount)*8 != fdxFileLength)
         // This is most likely a bug in Sun JRE 1.6.0_04/_05;
         // we detect that the bug has struck, here, and
         // throw an exception to prevent the corruption from
@@ -468,7 +468,7 @@
 
     final long tvxSize = directory.fileLength(segment + "." + IndexFileNames.VECTORS_INDEX_EXTENSION);
 
-    if (4+mergedDocs*16 != tvxSize)
+    if (4+((long) mergedDocs)*16 != tvxSize)
       // This is most likely a bug in Sun JRE 1.6.0_04/_05;
       // we detect that the bug has struck, here, and
       // throw an exception to prevent the corruption from



Mime
View raw message