From a4ad5a8d563955f345f26d7b38bba873463110a2 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Tue, 8 Mar 2011 15:10:57 +0000 Subject: [PATCH] LUCENE-2954: Fix CheckIndex to print correct version numbers and fail if tool was not updated. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1079386 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/src/java/org/apache/lucene/index/CheckIndex.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lucene/src/java/org/apache/lucene/index/CheckIndex.java b/lucene/src/java/org/apache/lucene/index/CheckIndex.java index a109afdb3de..ca8f357aba2 100644 --- a/lucene/src/java/org/apache/lucene/index/CheckIndex.java +++ b/lucene/src/java/org/apache/lucene/index/CheckIndex.java @@ -348,8 +348,14 @@ public class CheckIndex { if (format == DefaultSegmentInfosWriter.FORMAT_DIAGNOSTICS) { sFormat = "FORMAT_DIAGNOSTICS [Lucene 2.9]"; + } else if (format == DefaultSegmentInfosWriter.FORMAT_HAS_VECTORS) { + sFormat = "FORMAT_HAS_VECTORS [Lucene 3.1]"; + } else if (format == DefaultSegmentInfosWriter.FORMAT_3_1) { + sFormat = "FORMAT_3_1 [Lucene 3.1]"; } else if (format == DefaultSegmentInfosWriter.FORMAT_4_0) { sFormat = "FORMAT_4_0 [Lucene 4.0]"; + } else if (format == DefaultSegmentInfosWriter.FORMAT_CURRENT) { + throw new RuntimeException("BUG: You should update this tool!"); } else if (format < DefaultSegmentInfosWriter.FORMAT_CURRENT) { sFormat = "int=" + format + " [newer version of Lucene than this tool supports]"; skip = true;