On 8/24/11 6:20 AM, sebb wrote:
> The UnmodifiableVector class contains the following method:
>
> /** {@inheritDoc} */
> public RealVector add(RealVector w) {
> return v.add(w);
> }
>
> This looks like it would update the vector.
> It is only by tracing the code that one discovers that the add()
> method takes a copy of the vector first. This does not appear to be
> documented anywhere, but perhaps I missed it.
>
> It would be very helpful to include details in the Javadoc of which
> methods return copies, and which methods update the current object.
After reviewing the full set of now merged javadoc (thanks,
Gilles!), I could see your point better. I just committed changes
that try to make things more explicit. Please review. Thanks.
Phil
>
> For methods which return an updated object, it is a bug to ignore the
> return value.
> [cf. String.trim()] It would be nice if there were an annotation to denote
> this.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]