commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Brisard <>
Subject Re: [math] RealVector.toArray() vs. RealVector.getData()
Date Wed, 07 Sep 2011 06:27:14 GMT
True enough.
Maybe the use of one those two could be strongly discouraged.
I personally was puzzled the first time I saw those two methods. I was
even wondering wether one of them would not return a shallow copy
(when possible), while the other would return a deep copy. Had to look
at the source to finally realize that toArray() and getData() do
exactly the same thing.
As for incompatible change, we are talking about 3.0, which gives us
(that's how I understand it anyway) a little bit of liberty, as long
as it improves the library.

2011/9/7 Jochen Wiedmann <>:
> 2011/9/7 Sébastien Brisard <>:
>> Hi,
>> as noted in MATH-653, these two methods are redundant, and one should
>> go. Pros and cons are
>> * toArray() is fairly classical in the Java world
>> * but getData() is consistent with ArrayRealVector.getDataRef().
>> Personnaly, my preference goes to keeping toArray(). In order to
>> maintain consistency, should ArrayRealVector.getDataRef() be renamed
>> getArrayRef() ?
> Another Con; INcompatible change, which should be avoided, if
> possible. Redundancy is not a compelling reason for such changes.
> --
> Capitalism is the astounding belief that the most wickedest of men
> will do the most wickedest of things for the greatest good of
> everyone.
> John Maynard Keynes (
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message