commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: svn commit: r1343163 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math3/linear/ test/java/org/apache/commons/math3/linear/
Date Mon, 28 May 2012 11:03:11 GMT
Hi.

> >> [...]
> >> +    protected void checkIndices(final int start, final int end) {
> >> +        final int dim = getDimension();
> >> +        if ((start < 0) || (start >= dim)) {
> >> +            throw new OutOfRangeException(LocalizedFormats.INDEX,
> >> +                                          Integer.valueOf(start),
> >                                             ^^^^^^^^^^^^^^^
> >
> > Why do you call "valueOf"?
> >
> 
> I am not Sébastien, but this should be obvious:
> 
> The constructor used here is
> 
> public OutOfRangeException(Localizable specific,
> Number wrong,
> Number lo,
> Number hi)
> 
> Integer.valueOf() is the best way to convert  int -> Integer

No, the best way is to let the compiler do the conversion, in order to have
a cleaner source code.


Regards,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message