]> git.mxchange.org Git - jjobs-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:08:38 +0000 (02:08 +0200)
- static class fields or anything static must be ALL_UPPER_CASE
- renamed private method

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jjobs/beans/business/department/action/JobsAdminBranchOfficeActionWebRequestBean.java

index 59c37566c664bfcf5b53508e460edc87af9aa945..96256bf6da327f16fcdbb06dc5ba4d6da433bd8d 100644 (file)
@@ -65,7 +65,7 @@ public class JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
        /**
         * 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 JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
                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 JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
                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 JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
         */
        @SuppressWarnings ("ReturnOfCollectionOrArrayField")
        public List<OpeningTime> getBranchOpeningTimes () {
-               return branchOpeningTimes;
+               return BRANCH_OPENING_TIMES;
        }
 
        /**
@@ -552,7 +552,7 @@ public class JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
         */
        @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
        public void setBranchOpeningTimes (final List<OpeningTime> branchOpeningTimes) {
-               JobsAdminBranchOfficeActionWebRequestBean.branchOpeningTimes = branchOpeningTimes;
+               BRANCH_OPENING_TIMES = branchOpeningTimes;
        }
 
        /**
@@ -1098,14 +1098,11 @@ public class JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
         * @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 JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
         * <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;