commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Brisard <sebastien.bris...@m4x.org>
Subject Re: svn commit: r1343293 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealVector.java
Date Mon, 28 May 2012 16:12:12 GMT
2012/5/28 sebb <sebbaz@gmail.com>:
> On 28 May 2012 16:39,  <celestin@apache.org> wrote:
>> Author: celestin
>> Date: Mon May 28 15:39:57 2012
>> New Revision: 1343293
>>
>> URL: http://svn.apache.org/viewvc?rev=1343293&view=rev
>> Log:
>> Removed explicit conversion from int to Integer.
>
> -1; I don't think we had concensus on removing it.
>
>>
>> Modified:
>>    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealVector.java
>>
>> Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealVector.java
>> URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealVector.java?rev=1343293&r1=1343292&r2=1343293&view=diff
>> ==============================================================================
>> --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealVector.java
(original)
>> +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealVector.java
Mon May 28 15:39:57 2012
>> @@ -202,23 +202,17 @@ public abstract class RealVector {
>>     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),
>> -                                          Integer.valueOf(0),
>> -                                          Integer.valueOf(dim
- 1));
>> +            throw new OutOfRangeException(LocalizedFormats.INDEX, start, 0,
>> +                                          dim - 1);
>>         }
>>         if ((end < 0) || (end >= dim)) {
>> -            throw new OutOfRangeException(LocalizedFormats.INDEX,
>> -                                          Integer.valueOf(end),
>> -                                          Integer.valueOf(0),
>> -                                          Integer.valueOf(dim
- 1));
>> +            throw new OutOfRangeException(LocalizedFormats.INDEX, end, 0,
>> +                                          dim - 1);
>>         }
>> -        if (end < start){
>> +        if (end < start) {
>>             // TODO Use more specific error message
>>             throw new NumberIsTooSmallException(LocalizedFormats.INITIAL_ROW_AFTER_FINAL_ROW,
>> -                                                Integer.valueOf(end),
>> -                                                Integer.valueOf(start),
>> -                                                false);
>> +                                                end, start,
false);
>>         }
>>     }
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
That's true we didn't. However (see my last message), this is really
of little consequence, and I didn't really want to get into a new
"to-serialize-or-not-to-serialize-that-s-the-question" endless debate.
I was the one who initially defended explicit conversion as opposed to
autoboxing, so you need not convince me. I guess most IDEs would
signal this auto-boxing. Can we assume on this specific case that we
are adults who know what they are doing? Again, this is just to build
the message of an exception, so the code virtually ends here.
I'm not familiar with -1ing a commit, I think I have to revert it
(could you confirm on that?). I'm happy to, but please find a
consensus with Gilles then, and I'm very happy to line up with the
outcome of your discussions.

Kind regards,
Sébastien


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


Mime
View raw message