rmuir commented on pull request #1557:
URL: https://github.com/apache/lucene-solr/pull/1557#issuecomment-643285331


   i'm proposing something like this for the new method:
   ```
   if (expectedLength < footerLength()) {
     throw new IllegalArgumentException("expectedLength cannot be less than the 
footer length");
   }
   if (in.length() < expectedLength) {
     throw new CorruptIndexException("truncated file: length=" + in.length() + 
" but expectedLength==" + expectedLength, in);
   } else if (in.length() > expectedLength) {
     throw new CorruptIndexException("file too long: length=" + in.length() + " 
but expectedLength==" + expectedLength, in);
   }
   return retrieveChecksum(in);
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to