Skip to content

Commit

Permalink
[#3] Refactor, remove casts and use polymorphism to impl reduced() in…
Browse files Browse the repository at this point in the history
…stead
  • Loading branch information
EthanLin-TWer committed Jan 14, 2017
1 parent 5ff4462 commit f1b5532
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

public class Bank {
public Money reduced(Expression money, String toCurrency) {
// TODO: [Linesh][1/9/17] Is type cast a bad smell?
if (money instanceof Money) return money.reduced(toCurrency);
Sum sum = (Sum) money;
return sum.reduced(toCurrency);
return money.reduced(toCurrency);
}
}

0 comments on commit f1b5532

Please sign in to comment.