From db52f4ed7f4d57d59991d6894d4d783576451af3 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Tue, 27 Nov 2007 17:08:50 +0000 Subject: [PATCH] LUCENE-1069: fix CheckIndex to properly take deletions into account git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@598696 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/index/CheckIndex.java | 243 +++++++++++------- .../apache/lucene/index/TestCheckIndex.java | 51 ++++ 2 files changed, 203 insertions(+), 91 deletions(-) create mode 100644 src/test/org/apache/lucene/index/TestCheckIndex.java diff --git a/src/java/org/apache/lucene/index/CheckIndex.java b/src/java/org/apache/lucene/index/CheckIndex.java index aed32d01728..a6d47120170 100644 --- a/src/java/org/apache/lucene/index/CheckIndex.java +++ b/src/java/org/apache/lucene/index/CheckIndex.java @@ -23,6 +23,8 @@ import org.apache.lucene.store.IndexInput; import org.apache.lucene.document.Document; import java.text.NumberFormat; +import java.io.PrintStream; +import java.io.IOException; import java.util.Collection; import java.util.Iterator; @@ -38,53 +40,37 @@ import java.util.Iterator; public class CheckIndex { - public static void main(String[] args) throws Throwable { + public static PrintStream out = System.out; - boolean doFix = false; - for(int i=0;i