lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r735043 - in /lucene/java/trunk/src/java/org/apache/lucene/index: StoredFieldsWriter.java TermVectorsTermsWriter.java
Date Fri, 16 Jan 2009 16:18:33 GMT
Author: mikemccand
Date: Fri Jan 16 08:18:33 2009
New Revision: 735043

URL: http://svn.apache.org/viewvc?rev=735043&view=rev
Log:
LUCENE-1521: fix 2 more cases of int overflow

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/StoredFieldsWriter.java
    lucene/java/trunk/src/java/org/apache/lucene/index/TermVectorsTermsWriter.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/StoredFieldsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/StoredFieldsWriter.java?rev=735043&r1=735042&r2=735043&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/StoredFieldsWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/StoredFieldsWriter.java Fri Jan 16
08:18:33 2009
@@ -90,7 +90,7 @@
       state.docWriter.removeOpenFile(state.docStoreSegmentName + "." + IndexFileNames.FIELDS_EXTENSION);
       state.docWriter.removeOpenFile(state.docStoreSegmentName + "." + IndexFileNames.FIELDS_INDEX_EXTENSION);
 
-      if (4+state.numDocsInStore*8 != state.directory.fileLength(state.docStoreSegmentName
+ "." + IndexFileNames.FIELDS_INDEX_EXTENSION))
+      if (4+((long) state.numDocsInStore)*8 != state.directory.fileLength(state.docStoreSegmentName
+ "." + IndexFileNames.FIELDS_INDEX_EXTENSION))
         throw new RuntimeException("after flush: fdx size mismatch: " + state.numDocsInStore
+ " docs vs " + state.directory.fileLength(state.docStoreSegmentName + "." + IndexFileNames.FIELDS_INDEX_EXTENSION)
+ " length in bytes of " + state.docStoreSegmentName + "." + IndexFileNames.FIELDS_INDEX_EXTENSION);
     }
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/TermVectorsTermsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/TermVectorsTermsWriter.java?rev=735043&r1=735042&r2=735043&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/TermVectorsTermsWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/TermVectorsTermsWriter.java Fri Jan
16 08:18:33 2009
@@ -90,7 +90,7 @@
       tvd.close();
       tvx = null;
       assert state.docStoreSegmentName != null;
-      if (4+state.numDocsInStore*16 != state.directory.fileLength(state.docStoreSegmentName
+ "." + IndexFileNames.VECTORS_INDEX_EXTENSION))
+      if (4+((long) state.numDocsInStore)*16 != state.directory.fileLength(state.docStoreSegmentName
+ "." + IndexFileNames.VECTORS_INDEX_EXTENSION))
         throw new RuntimeException("after flush: tvx size mismatch: " + state.numDocsInStore
+ " docs vs " + state.directory.fileLength(state.docStoreSegmentName + "." + IndexFileNames.VECTORS_INDEX_EXTENSION)
+ " length in bytes of " + state.docStoreSegmentName + "." + IndexFileNames.VECTORS_INDEX_EXTENSION);
 
       state.flushedFiles.add(state.docStoreSegmentName + "." + IndexFileNames.VECTORS_INDEX_EXTENSION);



Mime
View raw message