Gal Nitzan wrote:

this function throws IOException. Why?

        public long getPos() throws IOException {
           return (doc*INDEX_LENGTH)/maxDoc;
         }

It should be throwing ArithmeticException

The IOException is required by the API of RecordReader.

What happens when maxDoc is zero?

Ka-boom! ;-) You're right, this should be wrapped in an IOException and rethrown.

--
Best regards,
Andrzej Bialecki     <><
___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


Reply via email to