]> git.mxchange.org Git - jbonuscard-core.git/commitdiff
Continued a bit:
authorRoland Häder <roland@mxchange.org>
Fri, 22 Sep 2017 23:57:02 +0000 (01:57 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 22 Sep 2017 23:59:33 +0000 (01:59 +0200)
- receiptNumber may be (valid!) null, but never < 1

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jfinancials/model/receipt/Receipts.java

index 7c0065078818f104d1e00b8f2e02944bf388ec54..c6e6493a8de631ce1cc9acc9875d5a2b7370aeb4 100644 (file)
@@ -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");