You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Luc Maisonobe <Lu...@free.fr> on 2008/01/13 21:16:32 UTC
[math] possible issue with ValueServer.getNextReplay()
Still playing with findbugs, I have encounter another thing I don't
understand.
The getNextReplay() method in ValueServer has a wrap feature to restart
file reading when EOF is encountered. This feature is triggered when
readLine returns null, but only one test is performed.
I think that this could produce a NullPointerException is the provided
file is empty. I don't see any check for this. Adding a check would
imply changing the method signature by adding a new Exception (the
method only declares throwing IOException).
Any thoughts about this ?
Lyc
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [math] possible issue with ValueServer.getNextReplay()
Posted by Phil Steitz <ph...@gmail.com>.
On Jan 13, 2008 1:16 PM, Luc Maisonobe <Lu...@free.fr> wrote:
> Still playing with findbugs, I have encounter another thing I don't
> understand.
>
> The getNextReplay() method in ValueServer has a wrap feature to restart
> file reading when EOF is encountered. This feature is triggered when
> readLine returns null, but only one test is performed.
>
> I think that this could produce a NullPointerException is the provided
> file is empty. I don't see any check for this. Adding a check would
> imply changing the method signature by adding a new Exception (the
> method only declares throwing IOException).
>
> Any thoughts about this ?
I have not tried with an empty file, but it looks to me like you
should get either IOException or NumberFormatException, as advertised.
Did you get NPE with an empty file?
Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org