You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2012/07/19 17:21:13 UTC

svn commit: r1363379 - /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java

Author: rmuir
Date: Thu Jul 19 15:21:12 2012
New Revision: 1363379

URL: http://svn.apache.org/viewvc?rev=1363379&view=rev
Log:
don't divide by 0 in the checkindex status: it totally confuses people to see the \uFFFD for the NaN

Modified:
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java?rev=1363379&r1=1363378&r2=1363379&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java Thu Jul 19 15:21:12 2012
@@ -1601,8 +1601,9 @@ public class CheckIndex {
           }
         }
       }
+      float vectorAvg = status.docCount == 0 ? 0 : status.totVectors / (float)status.docCount;
       msg("OK [" + status.totVectors + " total vector count; avg " + 
-          format.format((((float) status.totVectors) / status.docCount)) + " term/freq vector fields per doc]");
+          format.format(vectorAvg) + " term/freq vector fields per doc]");
     } catch (Throwable e) {
       msg("ERROR [" + String.valueOf(e.getMessage()) + "]");
       status.error = e;