From 454b16b5ac4bb70fecd0a490fd2d9c31a255cae4 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Wed, 6 Jun 2012 17:41:46 +0000 Subject: [PATCH] add asserts git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1346999 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/lucene/codecs/BlockTreeTermsWriter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsWriter.java index e7f3da0b953..7c2230761fa 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsWriter.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/BlockTreeTermsWriter.java @@ -639,7 +639,7 @@ public class BlockTreeTermsWriter extends FieldsConsumer { // for debugging @SuppressWarnings("unused") - private String toString(BytesRef b) { + private String toString(BytesRef b) { try { return b.utf8ToString() + " " + b; } catch (Throwable t) { @@ -896,6 +896,10 @@ public class BlockTreeTermsWriter extends FieldsConsumer { // System.out.println("SAVED to " + dotFileName); // w.close(); // } + } else { + assert sumTotalTermFreq == 0; + assert sumDocFreq == 0; + assert docCount == 0; } }