Terrier Users :  Terrier Forum terrier.org
General discussion about using/developing applications using Terrier 
Wrong qrels file leads to NullPointerException
Posted by: frousseau ()
Date: November 12, 2012 11:17AM

I am not sure if it's ok to open a new topic in the forum to file a bug report but I couldn't open a new issue on the tracker.

The bug is when you specify a wrong qrels file (in my case the topics file).
The bug occurs in org.terrier.evaluation.TRECQrelsInMemory.

Basically, in the method loadQrelsFile() (line 374), the catch block logs fatally an error:
FATAL - java.lang.NumberFormatException: For input string: ""
but the program doesn't not exit. (It's actually quite hard to know which line fired the exception since the try block is 30-line long...)

Then, in the method queryExistInQrels(String queryid) (line 459), the attribute qrelsPerQuery which has not been initialized (thus is null) is asked for its length which throws a java.lang.NullPointerException.

None of the logs is clear about being fed a wrong qrel file. And usually, when logging with fatal, the program is expected to exit isn't it (since it's fatal)?

Cheers,
Fran├žois

Options: ReplyQuote
Re: Wrong qrels file leads to NullPointerException
Posted by: craigm ()
Date: November 13, 2012 02:11PM

Thanks. The error messages could be more useful here. I opened an issue at [terrier.org]

Craig

Options: ReplyQuote


Sorry, only registered users may post in this forum.
This forum powered by Phorum.