From: Roland Häder Date: Fri, 22 Sep 2017 23:57:02 +0000 (+0200) Subject: Continued a bit: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=97c1c3882d48478d41c6987fbf8125a6dceaa60c;p=jfinancials-core.git Continued a bit: - receiptNumber may be (valid!) null, but never < 1 Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jfinancials/model/receipt/Receipts.java b/src/org/mxchange/jfinancials/model/receipt/Receipts.java index 7c00650..c6e6493 100644 --- a/src/org/mxchange/jfinancials/model/receipt/Receipts.java +++ b/src/org/mxchange/jfinancials/model/receipt/Receipts.java @@ -46,12 +46,6 @@ public class Receipts implements Serializable { } else if ((receipt1.getReceiptId() instanceof Long) && (receipt1.getReceiptId() < 1)) { // Throw IAE throw new IllegalArgumentException(MessageFormat.format("receipt1.receiptId={0} is not valid.", receipt1.getReceiptId())); - } else if (receipt1.getReceiptNumber() == null) { - // Throw NPE - throw new NullPointerException("receipt1.receiptNumber is null"); - } else if (receipt1.getReceiptNumber() < 1) { - // Throw IAE - throw new IllegalArgumentException(MessageFormat.format("receipt1.receiptNumber={0} is not valid", receipt1.getReceiptNumber())); } else if (receipt1.getReceiptBranchOffice() == null) { // Throw NPE throw new NullPointerException("receipt1.receiptBranchOffice is null"); @@ -61,6 +55,9 @@ public class Receipts implements Serializable { } else if (receipt1.getReceiptBranchOffice().getBranchId() < 1) { // Throw NPE throw new NullPointerException(MessageFormat.format("receipt1.receiptBranchOffice.branchId={0} is not valid", receipt1.getReceiptBranchOffice().getBranchId())); + } else if ((receipt1.getReceiptNumber() instanceof Long) && (receipt1.getReceiptNumber() < 1)) { + // Throw IAE + throw new IllegalArgumentException(MessageFormat.format("receipt1.receiptNumber={0} is not valid.", receipt1.getReceiptNumber())); } else if (receipt1.getReceiptPaymentType()== null) { // Throw NPE throw new NullPointerException("receipt1.receiptPaymentType is null"); @@ -70,12 +67,6 @@ public class Receipts implements Serializable { } else if ((receipt2.getReceiptId() instanceof Long) && (receipt2.getReceiptId() < 1)) { // Throw IAE throw new IllegalArgumentException(MessageFormat.format("receipt2.receiptId={0} is not valid.", receipt2.getReceiptId())); - } else if (receipt2.getReceiptNumber() == null) { - // Throw NPE - throw new NullPointerException("receipt2.receiptNumber is null"); - } else if (receipt2.getReceiptNumber() < 1) { - // Throw IAE - throw new IllegalArgumentException(MessageFormat.format("receipt2.receiptNumber={0} is not valid", receipt2.getReceiptNumber())); } else if (receipt2.getReceiptBranchOffice() == null) { // Throw NPE throw new NullPointerException("receipt2.receiptBranchOffice is null"); @@ -85,6 +76,9 @@ public class Receipts implements Serializable { } else if (receipt2.getReceiptBranchOffice().getBranchId() < 1) { // Throw NPE throw new NullPointerException(MessageFormat.format("receipt2.receiptBranchOffice.branchId={0} is not valid", receipt2.getReceiptBranchOffice().getBranchId())); + } else if ((receipt2.getReceiptNumber() instanceof Long) && (receipt2.getReceiptNumber() < 1)) { + // Throw IAE + throw new IllegalArgumentException(MessageFormat.format("receipt2.receiptNumber={0} is not valid.", receipt2.getReceiptNumber())); } else if (receipt2.getReceiptPaymentType()== null) { // Throw NPE throw new NullPointerException("receipt2.receiptPaymentType is null");