Permalink
Browse files

fix a few plases in CheckIndex to not try to call BytesRefBuilder.toS…

…tring (it hits an UnsupportedOperationException)
  • Loading branch information...
mikemccand committed Feb 26, 2016
1 parent 9bb9b79 commit 3c1b309d2d072bcdae93ea8b68a8595a7aa8ef9d
Showing with 5 additions and 5 deletions.
  1. +5 −5 lucene/core/src/java/org/apache/lucene/index/CheckIndex.java
@@ -955,7 +955,7 @@ private static long getDocsFromTermRange(String field, int maxDoc, TermsEnum ter
lastTerm.copyBytes(term);
} else {
if (lastTerm.get().compareTo(term) >= 0) {
throw new RuntimeException("terms out of order: lastTerm=" + lastTerm + " term=" + term);
throw new RuntimeException("terms out of order: lastTerm=" + lastTerm.get() + " term=" + term);
}
lastTerm.copyBytes(term);
}
@@ -1083,7 +1083,7 @@ private static void checkTermRanges(String field, int maxDoc, Terms terms, long
lastTerm.copyBytes(term);
} else {
if (lastTerm.get().compareTo(term) >= 0) {
throw new RuntimeException("terms out of order: lastTerm=" + lastTerm + " term=" + term);
throw new RuntimeException("terms out of order: lastTerm=" + lastTerm.get() + " term=" + term);
}
lastTerm.copyBytes(term);
}
@@ -1240,7 +1240,7 @@ private static void checkTermRanges(String field, int maxDoc, Terms terms, long
lastTerm.copyBytes(term);
} else {
if (lastTerm.get().compareTo(term) >= 0) {
throw new RuntimeException("terms out of order: lastTerm=" + lastTerm + " term=" + term);
throw new RuntimeException("terms out of order: lastTerm=" + lastTerm.get() + " term=" + term);
}
lastTerm.copyBytes(term);
}
@@ -1547,7 +1547,7 @@ private static void checkTermRanges(String field, int maxDoc, Terms terms, long
// Test seek to last term:
if (lastTerm != null) {
if (termsEnum.seekCeil(lastTerm.get()) != TermsEnum.SeekStatus.FOUND) {
throw new RuntimeException("seek to last term " + lastTerm + " failed");
throw new RuntimeException("seek to last term " + lastTerm.get() + " failed");
}
if (termsEnum.term().equals(lastTerm.get()) == false) {
throw new RuntimeException("seek to last term " + lastTerm.get() + " returned FOUND but seeked to the wrong term " + termsEnum.term());
@@ -1560,7 +1560,7 @@ private static void checkTermRanges(String field, int maxDoc, Terms terms, long
docFreq++;
}
if (docFreq != expectedDocFreq) {
throw new RuntimeException("docFreq for last term " + lastTerm.toBytesRef() + "=" + expectedDocFreq + " != recomputed docFreq=" + docFreq);
throw new RuntimeException("docFreq for last term " + lastTerm.get() + "=" + expectedDocFreq + " != recomputed docFreq=" + docFreq);
}
}

0 comments on commit 3c1b309

Please sign in to comment.