You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2020/07/29 14:05:40 UTC

[lucene-solr] branch branch_8x updated: LUCENE-9416: fix CheckIndex to print an invalid non-zero norm as unsigned long when detecting corruption

This is an automated email from the ASF dual-hosted git repository.

mikemccand pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new b339f98  LUCENE-9416: fix CheckIndex to print an invalid non-zero norm as unsigned long when detecting corruption
b339f98 is described below

commit b339f98fcbcaf6b1a7279410fefc0cb11ea5fa2c
Author: Mike McCandless <mi...@apache.org>
AuthorDate: Wed Jul 29 10:04:33 2020 -0400

    LUCENE-9416: fix CheckIndex to print an invalid non-zero norm as unsigned long when detecting corruption
---
 lucene/CHANGES.txt                                           | 3 +++
 lucene/core/src/java/org/apache/lucene/index/CheckIndex.java | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 4e420e0..fd1bc46 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -25,6 +25,9 @@ Improvements
   per hit in dependencies, ExpressionFunctionValues will no longer
   recompute already computed values (Haoyu Zhai)
 
+* LUCENE-9416: Fix CheckIndex to print an invalid non-zero norm as
+  unsigned long when detecting corruption.
+
 Optimizations
 ---------------------
 (No changes)
diff --git a/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java b/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java
index 909a081..e7e6522 100644
--- a/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java
+++ b/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java
@@ -1672,7 +1672,7 @@ public final class CheckIndex implements Closeable {
             }
             final long norm = norms.longValue();
             if (norm != 0 && visitedDocs.get(doc) == false) {
-              throw new RuntimeException("Document " + doc + " doesn't have terms according to postings but has a norm value that is not zero: " + norm);
+              throw new RuntimeException("Document " + doc + " doesn't have terms according to postings but has a norm value that is not zero: " + Long.toUnsignedString(norm));
             } else if (norm == 0 && visitedDocs.get(doc)) {
               throw new RuntimeException("Document " + doc + " has terms according to postings but its norm value is 0, which may only be used on documents that have no terms");
             }