You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Money.class implements the MonetaryAmount interface that specifies a negate method. According to the JavaDocs, the negate function shall return " a MonetaryAmount whose value is -this, and whose scale is this.scale().". However, the Money.negate() function does currently not return this.MonetaryContext (including this.scale and this.precision). This behaviour is unexpected and different to the implementations of the multiply, divide, add and subtract methods in the Money class, which return a MonetaryAmount with the correct MonetaryContext. When the operation x.negate() is conducted this may lead to a different result than the operation x.multiply(-1). This is unexpected . Please make negate return a MonetaryAmount with this.MonetaryContext.
The text was updated successfully, but these errors were encountered:
The Money.class implements the MonetaryAmount interface that specifies a negate method. According to the JavaDocs, the negate function shall return " a MonetaryAmount whose value is -this, and whose scale is this.scale().". However, the Money.negate() function does currently not return this.MonetaryContext (including this.scale and this.precision). This behaviour is unexpected and different to the implementations of the multiply, divide, add and subtract methods in the Money class, which return a MonetaryAmount with the correct MonetaryContext. When the operation x.negate() is conducted this may lead to a different result than the operation x.multiply(-1). This is unexpected . Please make negate return a MonetaryAmount with this.MonetaryContext.
The text was updated successfully, but these errors were encountered: