From: Roland Häder Date: Mon, 26 Sep 2022 00:07:32 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=58df3c62450d54977f53186c58631ea0572f656f;p=jfinancials-war.git Please cherry-pick: - static class fields or anything static must be ALL_UPPER_CASE - renamed private method --- diff --git a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/action/FinancialsAdminBranchOfficeActionWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/action/FinancialsAdminBranchOfficeActionWebRequestBean.java index 351f08a2..18aa19be 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/action/FinancialsAdminBranchOfficeActionWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/action/FinancialsAdminBranchOfficeActionWebRequestBean.java @@ -65,7 +65,7 @@ public class FinancialsAdminBranchOfficeActionWebRequestBean extends BaseFinanci /** * Opening times of this branch office */ - private static List branchOpeningTimes; + private static List 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 getBranchOpeningTimes () { - return branchOpeningTimes; + return BRANCH_OPENING_TIMES; } /** @@ -552,7 +552,7 @@ public class FinancialsAdminBranchOfficeActionWebRequestBean extends BaseFinanci */ @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter") public void setBranchOpeningTimes (final List 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 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 *

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