]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Mon, 26 Sep 2022 00:07:32 +0000 (02:07 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 26 Sep 2022 00:07:32 +0000 (02:07 +0200)
- static class fields or anything static must be ALL_UPPER_CASE
- renamed private method

src/java/org/mxchange/jfinancials/beans/business/branchoffice/action/FinancialsAdminBranchOfficeActionWebRequestBean.java

index 351f08a27ec99700ac9753365ad0c72a366ef5bb..18aa19be9720f6d9156fd6fc4c03966370101c89 100644 (file)
@@ -65,7 +65,7 @@ public class FinancialsAdminBranchOfficeActionWebRequestBean extends BaseFinanci
        /**
         * Opening times of this branch office
         */
-       private static List<OpeningTime> branchOpeningTimes;
+       private static List<OpeningTime> BRANCH_OPENING_TIMES;
 
        /**
         * Serial number
@@ -241,9 +241,9 @@ public class FinancialsAdminBranchOfficeActionWebRequestBean extends BaseFinanci
                super();
 
                // Is the opening times list there?
-               if (null == branchOpeningTimes) {
+               if (null == BRANCH_OPENING_TIMES) {
                        // Init list
-                       branchOpeningTimes = new ArrayList<>(1);
+                       BRANCH_OPENING_TIMES = new ArrayList<>(1);
                }
        }
 
@@ -306,14 +306,14 @@ public class FinancialsAdminBranchOfficeActionWebRequestBean extends BaseFinanci
                final OpeningTime openingTime = this.createOpeningTimes();
 
                // Is same found?
-               if (this.isSameOpeningTimeFound(openingTime)) {
+               if (this.isOpeningTimeFound(openingTime)) {
                        // Yes then abort here
                        this.showFacesMessage("form-admin-add-branch-opening-time:openingStartDay", "ADMIN_OPENING_TIME_ALREADY_CREATED", FacesMessage.SEVERITY_WARN); //NOI18N
                        return;
                }
 
                // Add to temporary list
-               branchOpeningTimes.add(openingTime);
+               getBranchOpeningTimes().add(openingTime);
 
                // Clear opening time fields
                this.clearOpeningTime();
@@ -542,7 +542,7 @@ public class FinancialsAdminBranchOfficeActionWebRequestBean extends BaseFinanci
         */
        @SuppressWarnings ("ReturnOfCollectionOrArrayField")
        public List<OpeningTime> getBranchOpeningTimes () {
-               return branchOpeningTimes;
+               return BRANCH_OPENING_TIMES;
        }
 
        /**
@@ -552,7 +552,7 @@ public class FinancialsAdminBranchOfficeActionWebRequestBean extends BaseFinanci
         */
        @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
        public void setBranchOpeningTimes (final List<OpeningTime> branchOpeningTimes) {
-               FinancialsAdminBranchOfficeActionWebRequestBean.branchOpeningTimes = branchOpeningTimes;
+               BRANCH_OPENING_TIMES = branchOpeningTimes;
        }
 
        /**
@@ -1098,14 +1098,11 @@ public class FinancialsAdminBranchOfficeActionWebRequestBean extends BaseFinanci
         * @return Whether the address has been found
         */
        private boolean isBranchOfficeCreatedBySameAddress (final BranchOffice branchOffice) {
-               // Get full list from other bean
-               final List<BranchOffice> branchOffices = this.branchOfficeListController.getAllBranchOffices();
-
                // Default is not found
                boolean isFound = false;
 
                // Now check each entry
-               for (final BranchOffice bo : branchOffices) {
+               for (final BranchOffice bo : this.branchOfficeListController.getAllBranchOffices()) {
                        // Is same address?
                        if (BranchOffices.isSameAddress(bo, branchOffice)) {
                                // Found one
@@ -1125,7 +1122,7 @@ public class FinancialsAdminBranchOfficeActionWebRequestBean extends BaseFinanci
         * <p>
         * @return Whether it has been added already
         */
-       private boolean isSameOpeningTimeFound (final OpeningTime openingTime) {
+       private boolean isOpeningTimeFound (final OpeningTime openingTime) {
                // Default is not found
                boolean isFound = false;