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: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org