Skip to content

Commit

Permalink
Fix Stack Overflow Exception in MwStRechner.PlainOOP#calculateMwSt as…
Browse files Browse the repository at this point in the history
… reported by kabutz in #1
  • Loading branch information
MBoegers committed Mar 31, 2023
1 parent 42ac8a8 commit 2d3c168
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/io/github/mboegers/dop/invoice/MwStRechner.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ private PlainOOP() {
* ermöglicht einen einheitlichen Zugriff
*/
public static double calculateMwSt(Kunde kunde, double wert) {
return calculateMwSt(kunde, wert);
if (kunde instanceof Privatkunde) {
return calculateMwSt((Privatkunde) kunde, wert);
} else if (kunde instanceof Businesskunde) {
return calculateMwSt((Businesskunde) kunde, wert);
} else {
throw new IllegalArgumentException("Typ %s nicht implementiert".formatted(kunde));
}
}

/**
Expand Down

0 comments on commit 2d3c168

Please sign in to comment.