commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: [MATH] Javadoc for vector methods
Date Sun, 28 Aug 2011 15:55:44 GMT
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: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


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


Mime
View raw message