commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject [MATH] Javadoc for vector methods
Date Wed, 24 Aug 2011 13:20:59 GMT
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.

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:
For additional commands, e-mail:

View raw message