Closed andi-huber closed 3 years ago
fixed with #340
@andi-huber Are we sure, the code in divide() is correct, because the JavaDoc says:
@return <code>this.multiply(that.pow(-1))</code>
, but the code to divide "foreign" dimensions is now
that.divide(this).pow(-1)
, also matching the JavaDoc comment, but the return
tag now has a mismatch. Which is correct?
Hi @keilw - the java-doc return
tag in UnitDimension#divide(Dimension)
does not need to be that specific, as this is an implementation detail of Indriya. We should change that to eg.
@return this / that
which would be in line with what UnitDimension#multiply(Dimension)
states, namely @return this * that
.
However, the java-doc description of what happens when a 'foreign' Dimension implementation is passed in as an argument, should be specific. So that's what I added yesterday:
If the specified dimension is not a physics dimension, then
<code>that.divide(this).pow(-1)</code> is returned.
I took the freedom to push a java-doc correction to 'master'.
As an experienced contributor that's OK thank you.
However, looking at it again, shouldn't @return <code>that / this</code>
be like @return <code>this * that</code>
?
I'll fix that because you may have missed the Java 9 Multi-Release-version in this case, too. Correct me if I'm wrong, but I think it should always be this
fist.
Correct, I got that java-doc wrong. Thanks for spotting and correction!
As reported with https://github.com/unitsofmeasurement/uom-se/issues/216 also affects Indriya.