From: Roland Häder Date: Sat, 14 Oct 2017 19:03:47 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=50c9714168339d052da340bec050e00c9a28fd5c;p=jfinancials-war.git Please cherry-pick: - simplified for() loop, no need for extra iteration + next instance as a simple double-dot (:) does the same on a List Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestBean.java index c5d12c37..afab9ec8 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBusinessDataWebRequestBean.java @@ -375,15 +375,12 @@ public class FinancialsBusinessDataWebRequestBean extends BaseFinancialsBean imp // Is cache there? if (!this.basicDataCache.iterator().hasNext()) { // Get whole list - final List list = this.businessDataBean.allCompanyBasicData(); + final List basicDatas = this.businessDataBean.allCompanyBasicData(); // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final BusinessBasicData next = iterator.next(); - + for (final BusinessBasicData basicData : basicDatas) { // Add it to cache - this.basicDataCache.put(next.getBasicDataId(), next); + this.basicDataCache.put(basicData.getBasicDataId(), basicData); } } diff --git a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestBean.java index fe35a43d..61210692 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/branchoffice/FinancialsBranchOfficeWebRequestBean.java @@ -146,15 +146,12 @@ public class FinancialsBranchOfficeWebRequestBean extends BaseFinancialsBean imp // Is cache there? if (!this.branchOfficeCache.iterator().hasNext()) { // Get whole list - final List list = this.branchOfficeBean.allBranchOffices(); + final List branchOffices = this.branchOfficeBean.allBranchOffices(); // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final BranchOffice next = iterator.next(); - + for (final BranchOffice branchOffice : branchOffices) { // Add it to cache - this.branchOfficeCache.put(next.getBranchId(), next); + this.branchOfficeCache.put(branchOffice.getBranchId(), branchOffice); } } diff --git a/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsDepartmentWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsDepartmentWebRequestBean.java index 294670fc..da0b7f22 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsDepartmentWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/department/FinancialsDepartmentWebRequestBean.java @@ -146,15 +146,12 @@ public class FinancialsDepartmentWebRequestBean extends BaseFinancialsBean imple // Is cache there? if (!this.departmentCache.iterator().hasNext()) { // Get whole list - final List list = this.departmentBean.allDepartments(); + final List departments = this.departmentBean.allDepartments(); // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final Department next = iterator.next(); - + for (final Department department : departments) { // Add it to cache - this.departmentCache.put(next.getDepartmentId(), next); + this.departmentCache.put(department.getDepartmentId(), department); } } diff --git a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java index 98ae943b..49621af2 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/employee/FinancialsEmployeeWebRequestBean.java @@ -146,15 +146,12 @@ public class FinancialsEmployeeWebRequestBean extends BaseFinancialsBean impleme // Is cache there? if (!this.employeeCache.iterator().hasNext()) { // Get whole list - final List list = this.employeeBean.allCompanyEmployees(); + final List employees = this.employeeBean.allCompanyEmployees(); // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final Employee next = iterator.next(); - + for (final Employee employee : employees) { // Add it to cache - this.employeeCache.put(next.getEmployeeId(), next); + this.employeeCache.put(employee.getEmployeeId(), employee); } } diff --git a/src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsOpeningTimeWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsOpeningTimeWebRequestBean.java index 093b59b4..c5d8382e 100644 --- a/src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsOpeningTimeWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/business/opening_time/FinancialsOpeningTimeWebRequestBean.java @@ -142,15 +142,12 @@ public class FinancialsOpeningTimeWebRequestBean extends BaseFinancialsBean impl // Is cache there? if (!this.openingTimesCache.iterator().hasNext()) { // Get whole list - final List list = this.openingTimesBean.allOpeningTimes(); + final List openingTimes = this.openingTimesBean.allOpeningTimes(); // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final OpeningTime next = iterator.next(); - + for (final OpeningTime openingTime : openingTimes) { // Add it to cache - this.openingTimesCache.put(next.getOpeningId(), next); + this.openingTimesCache.put(openingTime.getOpeningId(), openingTime); } } diff --git a/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java index 9bcc4e61..62db3b85 100644 --- a/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java @@ -124,15 +124,12 @@ public class FinancialsCountryWebRequestBean extends BaseFinancialsBean implemen // Is cache there? if (!this.countryCache.iterator().hasNext()) { // Get whole list - final List list = this.countryBean.allCountries(); + final List countries = this.countryBean.allCountries(); // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final Country next = iterator.next(); - + for (final Country country : countries) { // Add it to cache - this.countryCache.put(next.getCountryId(), next); + this.countryCache.put(country.getCountryId(), country); } } } diff --git a/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsMobileProviderWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsMobileProviderWebRequestBean.java index 0c1b079a..f1b0a41a 100644 --- a/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/mobileprovider/FinancialsMobileProviderWebRequestBean.java @@ -144,15 +144,12 @@ public class FinancialsMobileProviderWebRequestBean extends BaseFinancialsBean i // Is cache there? if (!this.mobileProviderCache.iterator().hasNext()) { // Get whole list - final List list = this.mobileProviderBean.allMobileProviders(); + final List mobileProviders = this.mobileProviderBean.allMobileProviders(); // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final MobileProvider next = iterator.next(); - + for (final MobileProvider mobileProvider : mobileProviders) { // Add it to cache - this.mobileProviderCache.put(next.getProviderId(), next); + this.mobileProviderCache.put(mobileProvider.getProviderId(), mobileProvider); } } diff --git a/src/java/org/mxchange/jfinancials/beans/phone/FinancialsPhoneWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/phone/FinancialsPhoneWebRequestBean.java index 2c515c89..30b1c68e 100644 --- a/src/java/org/mxchange/jfinancials/beans/phone/FinancialsPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/phone/FinancialsPhoneWebRequestBean.java @@ -554,45 +554,36 @@ public class FinancialsPhoneWebRequestBean extends BaseFinancialsBean implements // Is cache there? if (!this.faxNumberCache.iterator().hasNext()) { // Get whole list - final List list = this.phoneBean.allFaxNumbers(); + final List faxNumbers = this.phoneBean.allFaxNumbers(); // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final DialableFaxNumber next = iterator.next(); - + for (final DialableFaxNumber faxNumber : faxNumbers) { // Add it to cache - this.faxNumberCache.put(next.getPhoneId(), next); + this.faxNumberCache.put(faxNumber.getPhoneId(), faxNumber); } } // Is cache there? if (!this.landLineNumberCache.iterator().hasNext()) { // Get whole list - final List list = this.phoneBean.allLandLineNumbers(); + final List lineNumbers = this.phoneBean.allLandLineNumbers(); // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final DialableLandLineNumber next = iterator.next(); - + for (final DialableLandLineNumber lineNumber : lineNumbers) { // Add it to cache - this.landLineNumberCache.put(next.getPhoneId(), next); + this.landLineNumberCache.put(lineNumber.getPhoneId(), lineNumber); } } // Is cache there? if (!this.mobileNumberCache.iterator().hasNext()) { // Get whole list - final List list = this.phoneBean.allMobileNumbers(); + final List mobileNumbers = this.phoneBean.allMobileNumbers(); // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final DialableMobileNumber next = iterator.next(); - + for (final DialableMobileNumber mobileNumber : mobileNumbers) { // Add it to cache - this.mobileNumberCache.put(next.getPhoneId(), next); + this.mobileNumberCache.put(mobileNumber.getPhoneId(), mobileNumber); } } } diff --git a/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java index b8f29716..27ddc39a 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java @@ -828,16 +828,13 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements // Is cache there? if (!this.userCache.iterator().hasNext()) { // Get whole list - final List list = this.userBean.allUsers(); + final List users = this.userBean.allUsers(); // Add all - for (final Iterator iterator = list.iterator(); iterator.hasNext();) { - // Get next element - final User next = iterator.next(); - + for (final User user : users) { // Add it to cache - this.userCache.put(next.getUserId(), next); - this.userNameCache.put(next.getUserId(), next.getUserName()); + this.userCache.put(user.getUserId(), user); + this.userNameCache.put(user.getUserId(), user.getUserName()); } } diff --git a/src/java/org/mxchange/jfinancials/beans/user/activity/FinancialsUserActivityWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/activity/FinancialsUserActivityWebRequestBean.java index 31473bf4..62eaa504 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/activity/FinancialsUserActivityWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/activity/FinancialsUserActivityWebRequestBean.java @@ -545,10 +545,10 @@ public class FinancialsUserActivityWebRequestBean extends BaseFinancialsBean imp @PostConstruct public void init () { // Get whole list - final List list = this.userActivityBean.fetchAllUserActivityLog(); + final List userActivities = this.userActivityBean.fetchAllUserActivityLog(); // Put all in map, per-user - for (final LogableUserActivity userActivity : list) { + for (final LogableUserActivity userActivity : userActivities) { // Is the list there? if (!this.userActivityCache.containsKey(userActivity.getActivityUser())) { // Init list diff --git a/web/WEB-INF/links.jsf.taglib.xml b/web/WEB-INF/links.jsf.taglib.xml index a0841d5a..d07704b7 100644 --- a/web/WEB-INF/links.jsf.taglib.xml +++ b/web/WEB-INF/links.jsf.taglib.xml @@ -55,7 +55,7 @@ along with this program. If not, see . renderShowLink - Whether this tag is used to show mobile data (default true). + Whether this tag is used to show fax data (default true). false java.lang.Boolean @@ -84,7 +84,7 @@ along with this program. If not, see . renderShowLink - Whether this tag is used to show mobile data (default true). + Whether this tag is used to show land-line data (default true). false java.lang.Boolean @@ -136,7 +136,7 @@ along with this program. If not, see . renderShowLink - Whether this tag is used to show mobile data (default true). + Whether this tag is used to show mobile provider data (default true). false java.lang.Boolean diff --git a/web/WEB-INF/widgets.jsf.taglib.xml b/web/WEB-INF/widgets.jsf.taglib.xml index 8fa3bebe..c8b9fb57 100644 --- a/web/WEB-INF/widgets.jsf.taglib.xml +++ b/web/WEB-INF/widgets.jsf.taglib.xml @@ -193,7 +193,7 @@ along with this program. If not, see . resources/tags/admin/panel_grids/fax/admin_fax_data.tpl renderShowLink - Whether this tag is used to show mobile data (default true). + Whether this tag is used to show fax data (default true). false java.lang.Boolean @@ -228,7 +228,7 @@ along with this program. If not, see . resources/tags/admin/panel_grids/landline/admin_landline_data.tpl renderShowLink - Whether this tag is used to show mobile data (default true). + Whether this tag is used to show land-line data (default true). false java.lang.Boolean