X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Forg%2Fmxchange%2Fjfinancials%2Fmodel%2Freceipt%2FReceipts.java;h=c6e6493a8de631ce1cc9acc9875d5a2b7370aeb4;hb=97c1c3882d48478d41c6987fbf8125a6dceaa60c;hp=7c0065078818f104d1e00b8f2e02944bf388ec54;hpb=482bc688206992f6390a4cf50223c658a89296a7;p=jbonuscard-core.git 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");