@@ -254,16 +254,14 @@ public Money plus(final BigDecimal amountToAdd, MathContext mc) {
254254 if (amountToAdd == null || amountToAdd .compareTo (BigDecimal .ZERO ) == 0 ) {
255255 return this ;
256256 }
257- final BigDecimal newAmount = this .amount .add (amountToAdd );
258- return Money .of (getCurrencyData (), newAmount , mc );
257+ return this .plus (Money .of (this .getCurrency (), amountToAdd , mc ));
259258 }
260259
261260 public Money plus (final double amountToAdd ) {
262261 if (amountToAdd == 0 ) {
263262 return this ;
264263 }
265- final BigDecimal newAmount = this .amount .add (BigDecimal .valueOf (amountToAdd ));
266- return Money .of (getCurrencyData (), newAmount );
264+ return this .plus (Money .of (this .getCurrency (), BigDecimal .valueOf (amountToAdd ), mc ));
267265 }
268266
269267 public Money minus (final Money moneyToSubtract ) {
@@ -298,8 +296,7 @@ public Money add(final BigDecimal amountToAdd, final MathContext mc) {
298296 if (amountToAdd == null || amountToAdd .compareTo (BigDecimal .ZERO ) == 0 ) {
299297 return this ;
300298 }
301- final BigDecimal newAmount = this .amount .add (amountToAdd );
302- return Money .of (getCurrencyData (), newAmount , mc );
299+ return this .plus (Money .of (this .getCurrency (), amountToAdd , mc ));
303300 }
304301
305302 public Money minus (final BigDecimal amountToSubtract ) {
@@ -310,8 +307,7 @@ public Money minus(final BigDecimal amountToSubtract, final MathContext mc) {
310307 if (amountToSubtract == null || amountToSubtract .compareTo (BigDecimal .ZERO ) == 0 ) {
311308 return this ;
312309 }
313- final BigDecimal newAmount = this .amount .subtract (amountToSubtract );
314- return Money .of (getCurrencyData (), newAmount , mc );
310+ return this .minus (Money .of (this .getCurrency (), amountToSubtract , mc ));
315311 }
316312
317313 private Money checkCurrencyEqual (final Money money ) {
0 commit comments