jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: svn commit: r1491213 - in /jmeter/trunk: src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/ src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/ xdocs/
Date Sun, 09 Jun 2013 14:27:46 GMT
On 9 June 2013 15:16, sebb <> wrote:

>>> On 9 June 2013 14:07,  <> wrote:
>>> Not sure what the point of the numeric check is - why not just let the
>>> parseInt fail?
>> To avoid Exception throwing which has higher cost than testing for numeric.
> The saving if any is likely to be marginal.
>> Feel free to change if you want.
> Since a non-numeric value is not valid, why should it matter if it
> takes slightly longer to process?
> I think the validation is unnecessary here.

And some strings which are valid to parseInt will fail the isNumeric check.

parseInt allows for a leading '-'; isNumeric does not.
As it happens, that's not allowed here, but in general it's better to
allow the parsing routine to decide what's valid.

It would certainly not be safe to use isNumeric if the number was
going to be converted with Integer.decode().

View raw message