]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 14 Oct 2017 19:03:47 +0000 (21:03 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 19 Jul 2019 22:48:00 +0000 (00:48 +0200)
- simplified for() loop, no need for extra iteration + next instance as a simple
  double-dot (:) does the same on a List<Foo>

Signed-off-by: Roland Häder <roland@mxchange.org>
12 files changed:
src/java/org/mxchange/jjobs/beans/business/basicdata/JobsBusinessDataWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsBranchOfficeWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/department/JobsDepartmentWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/employee/JobsCompanyEmployeeWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/opening_time/JobsOpeningTimeWebRequestBean.java
src/java/org/mxchange/jjobs/beans/country/JobsCountryWebRequestBean.java
src/java/org/mxchange/jjobs/beans/mobileprovider/JobsMobileProviderWebRequestBean.java
src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebRequestBean.java
web/WEB-INF/links.jsf.taglib.xml
web/WEB-INF/widgets.jsf.taglib.xml

index c443c2789983f974785efab81c77f2fa7c9d2ee1..0b09570b0664ac056c3b19d2f2008e4fc5bba84c 100644 (file)
@@ -375,15 +375,12 @@ public class JobsBusinessDataWebRequestBean extends BaseJobsBean implements Jobs
                // Is cache there?
                if (!this.basicDataCache.iterator().hasNext()) {
                        // Get whole list
-                       final List<BusinessBasicData> list = this.businessDataBean.allCompanyBasicData();
+                       final List<BusinessBasicData> basicDatas = this.businessDataBean.allCompanyBasicData();
 
                        // Add all
-                       for (final Iterator<BusinessBasicData> 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);
                        }
                }
 
index be301316e3af1fde8ba056e7779bdaafda2a0cef..8b8aebd723f166e4250592715994da56f48ebb81 100644 (file)
@@ -146,15 +146,12 @@ public class JobsBranchOfficeWebRequestBean extends BaseJobsBean implements Jobs
                // Is cache there?
                if (!this.branchOfficeCache.iterator().hasNext()) {
                        // Get whole list
-                       final List<BranchOffice> list = this.branchOfficeBean.allBranchOffices();
+                       final List<BranchOffice> branchOffices = this.branchOfficeBean.allBranchOffices();
 
                        // Add all
-                       for (final Iterator<BranchOffice> 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);
                        }
                }
 
index 2676e98c40a9bcd608b15bbfd3e50ab3311a682f..422f0c5dbecc8fbab9d8e58a0db30583c6451dd4 100644 (file)
@@ -146,15 +146,12 @@ public class JobsDepartmentWebRequestBean extends BaseJobsBean implements JobsDe
                // Is cache there?
                if (!this.departmentCache.iterator().hasNext()) {
                        // Get whole list
-                       final List<Department> list = this.departmentBean.allDepartments();
+                       final List<Department> departments = this.departmentBean.allDepartments();
 
                        // Add all
-                       for (final Iterator<Department> 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);
                        }
                }
 
index 43ad415accd78d01417c69bdc67eb3e6b434c7f5..bfb58e52822ad46ddc3f906803b657d977e24598 100644 (file)
@@ -146,15 +146,12 @@ public class JobsEmployeeWebRequestBean extends BaseJobsBean implements JobsEmpl
                // Is cache there?
                if (!this.employeeCache.iterator().hasNext()) {
                        // Get whole list
-                       final List<Employee> list = this.employeeBean.allCompanyEmployees();
+                       final List<Employee> employees = this.employeeBean.allCompanyEmployees();
 
                        // Add all
-                       for (final Iterator<Employee> 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);
                        }
                }
 
index ca350fa73d5c99b8cc978965394cb906d473030f..c0fae99d8241adc95cc0764a35b9d2266f7b560e 100644 (file)
@@ -142,15 +142,12 @@ public class JobsOpeningTimeWebRequestBean extends BaseJobsBean implements JobsO
                // Is cache there?
                if (!this.openingTimesCache.iterator().hasNext()) {
                        // Get whole list
-                       final List<OpeningTime> list = this.openingTimesBean.allOpeningTimes();
+                       final List<OpeningTime> openingTimes = this.openingTimesBean.allOpeningTimes();
 
                        // Add all
-                       for (final Iterator<OpeningTime> 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);
                        }
                }
 
index 94a27c29963e2ef1832b08dc6505c02ca381e10b..112a1b62538f566f245144b5d5f7bcf563222aa6 100644 (file)
@@ -124,15 +124,12 @@ public class JobsCountryWebRequestBean extends BaseJobsBean implements JobsCount
                // Is cache there?
                if (!this.countryCache.iterator().hasNext()) {
                        // Get whole list
-                       final List<Country> list = this.countryBean.allCountries();
+                       final List<Country> countries = this.countryBean.allCountries();
 
                        // Add all
-                       for (final Iterator<Country> 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);
                        }
                }
        }
index 8c796220b1fe6dcc96cdcd5343f9be1668866804..5975a5accfcc5911529b950931828bfd89e2c668 100644 (file)
@@ -144,15 +144,12 @@ public class JobsMobileProviderWebRequestBean extends BaseJobsBean implements Jo
                // Is cache there?
                if (!this.mobileProviderCache.iterator().hasNext()) {
                        // Get whole list
-                       final List<MobileProvider> list = this.mobileProviderBean.allMobileProviders();
+                       final List<MobileProvider> mobileProviders = this.mobileProviderBean.allMobileProviders();
 
                        // Add all
-                       for (final Iterator<MobileProvider> 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);
                        }
                }
 
index ec3188407074c5b3643c7ef67d710a78a6e5b90e..14039ba92f89ffcd54c07229eb87dfd8fe8cad17 100644 (file)
@@ -554,45 +554,36 @@ public class JobsPhoneWebRequestBean extends BaseJobsBean implements JobsPhoneWe
                // Is cache there?
                if (!this.faxNumberCache.iterator().hasNext()) {
                        // Get whole list
-                       final List<DialableFaxNumber> list = this.phoneBean.allFaxNumbers();
+                       final List<DialableFaxNumber> faxNumbers = this.phoneBean.allFaxNumbers();
 
                        // Add all
-                       for (final Iterator<DialableFaxNumber> 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<DialableLandLineNumber> list = this.phoneBean.allLandLineNumbers();
+                       final List<DialableLandLineNumber> lineNumbers = this.phoneBean.allLandLineNumbers();
 
                        // Add all
-                       for (final Iterator<DialableLandLineNumber> 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<DialableMobileNumber> list = this.phoneBean.allMobileNumbers();
+                       final List<DialableMobileNumber> mobileNumbers = this.phoneBean.allMobileNumbers();
 
                        // Add all
-                       for (final Iterator<DialableMobileNumber> 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);
                        }
                }
        }
index e9d86a4230ce2953de84a27e131fb0d5f27d2739..2a3ee65e4967b98d31cc76f0711f446200089a0d 100644 (file)
@@ -828,16 +828,13 @@ public class JobsUserWebRequestBean extends BaseJobsBean implements JobsUserWebR
                // Is cache there?
                if (!this.userCache.iterator().hasNext()) {
                        // Get whole list
-                       final List<User> list = this.userBean.allUsers();
+                       final List<User> users = this.userBean.allUsers();
 
                        // Add all
-                       for (final Iterator<User> 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());
                        }
                }
 
index 3beb2c04d62308cf020336a86187fd2078300973..a5d6e377224a81eac4ca02f7298b2584e0999217 100644 (file)
@@ -545,10 +545,10 @@ public class JobsUserActivityWebRequestBean extends BaseJobsBean implements Jobs
        @PostConstruct
        public void init () {
                // Get whole list
-               final List<LogableUserActivity> list = this.userActivityBean.fetchAllUserActivityLog();
+               final List<LogableUserActivity> 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
index a0841d5af86e8bb960cf95f59a80af68bae1933f..d07704b7ce9899254467cce4a2690f79f46f69d9 100644 (file)
@@ -55,7 +55,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                </attribute>
                <attribute>
                        <name>renderShowLink</name>
-                       <description>Whether this tag is used to show mobile data (default true).</description>
+                       <description>Whether this tag is used to show fax data (default true).</description>
                        <required>false</required>
                        <type>java.lang.Boolean</type>
                </attribute>
@@ -84,7 +84,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                </attribute>
                <attribute>
                        <name>renderShowLink</name>
-                       <description>Whether this tag is used to show mobile data (default true).</description>
+                       <description>Whether this tag is used to show land-line data (default true).</description>
                        <required>false</required>
                        <type>java.lang.Boolean</type>
                </attribute>
@@ -136,7 +136,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                </attribute>
                <attribute>
                        <name>renderShowLink</name>
-                       <description>Whether this tag is used to show mobile data (default true).</description>
+                       <description>Whether this tag is used to show mobile provider data (default true).</description>
                        <required>false</required>
                        <type>java.lang.Boolean</type>
                </attribute>
index 8fa3bebee1c964b6d390b4425b5bca41c258efc7..c8b9fb57ae7603a03dbee47b1328ea4f9f1394f3 100644 (file)
@@ -193,7 +193,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                <source>resources/tags/admin/panel_grids/fax/admin_fax_data.tpl</source>
                <attribute>
                        <name>renderShowLink</name>
-                       <description>Whether this tag is used to show mobile data (default true).</description>
+                       <description>Whether this tag is used to show fax data (default true).</description>
                        <required>false</required>
                        <type>java.lang.Boolean</type>
                </attribute>
@@ -228,7 +228,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                <source>resources/tags/admin/panel_grids/landline/admin_landline_data.tpl</source>
                <attribute>
                        <name>renderShowLink</name>
-                       <description>Whether this tag is used to show mobile data (default true).</description>
+                       <description>Whether this tag is used to show land-line data (default true).</description>
                        <required>false</required>
                        <type>java.lang.Boolean</type>
                </attribute>