rmuir commented on code in PR #16891:
URL: https://github.com/apache/lucene/pull/16891#discussion_r4352330116
##########
lucene/core/src/java/org/apache/lucene/codecs/lucene90/compressing/Lucene90CompressingStoredFieldsReader.java:
##########
@@ -694,20 +695,23 @@ public void document(int docID, StoredFieldVisitor
visitor) throws IOException {
final long infoAndBits = doc.in.readVLong();
final int fieldNumber = (int) (infoAndBits >>> TYPE_BITS);
final FieldInfo fieldInfo = fieldInfos.fieldInfo(fieldNumber);
+ if (fieldInfo == null) {
+ throw new CorruptIndexException(
+ "Unknown field number: " + fieldNumber + ", docID=" + docID,
fieldsStream);
+ }
final int bits = (int) (infoAndBits & TYPE_MASK);
- assert bits <= NUMERIC_DOUBLE : "bits=" + Integer.toHexString(bits);
Review Comment:
yeah i'm just worried we lose the clear check if the bits are wrong though.
I don't think we should remove asserts just to deliver CorruptIndexException (i
dislike this exception to begin with for reasons already stated). Seems like
the wrong tradeoff?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]