From 940f90e7f68fcaa5729ce0ff4b6a68e3c7fec657 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 26 Sep 2022 02:07:32 +0200 Subject: [PATCH] Please cherry-pick: - static class fields or anything static must be ALL_UPPER_CASE - renamed private method MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- ...AdminBranchOfficeActionWebRequestBean.java | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/java/org/mxchange/jjobs/beans/business/department/action/JobsAdminBranchOfficeActionWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/department/action/JobsAdminBranchOfficeActionWebRequestBean.java index 59c37566..96256bf6 100644 --- a/src/java/org/mxchange/jjobs/beans/business/department/action/JobsAdminBranchOfficeActionWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/business/department/action/JobsAdminBranchOfficeActionWebRequestBean.java @@ -65,7 +65,7 @@ public class JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl /** * Opening times of this branch office */ - private static List branchOpeningTimes; + private static List 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 getBranchOpeningTimes () { - return branchOpeningTimes; + return BRANCH_OPENING_TIMES; } /** @@ -552,7 +552,7 @@ public class JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl */ @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter") public void setBranchOpeningTimes (final List 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 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 *

* @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; -- 2.39.5