]> git.mxchange.org Git - addressbook-war.git/commitdiff
Some performance tuning: get list only if submittedValue is set non-empty
authorRoland Haeder <roland@mxchange.org>
Fri, 4 Mar 2016 20:44:53 +0000 (21:44 +0100)
committerRoland Haeder <roland@mxchange.org>
Fri, 4 Mar 2016 20:44:53 +0000 (21:44 +0100)
src/java/org/mxchange/addressbook/converter/country/CountryConverter.java
src/java/org/mxchange/addressbook/converter/smsprovider/SmsProviderConverter.java

index 63dc22c65ef4c310f81fb38f57c25cd28dbc632e..4f1dffaf6c22d01e4f0a1cad251ec860802c722a 100644 (file)
@@ -75,9 +75,6 @@ public class CountryConverter implements Converter {
                // Trace message
                this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2},this.countryController={3} - CALLED!", context, component, submittedValue, this.countryController)); //NOI18N
 
-               // Get full list
-               List<Country> countryList = this.countryController.allCountries();
-
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Trace message
@@ -87,6 +84,9 @@ public class CountryConverter implements Converter {
                        return null;
                }
 
+               // Get full list
+               List<Country> countryList = this.countryController.allCountries();
+
                // Init value
                Country country = null;
 
index b22a8bc81922e1d047c9b2a2c3e480f1d218bc52..e67ec8e221fe8c58a7a96ccf0abcd53b5850fda1 100644 (file)
@@ -75,9 +75,6 @@ public class SmsProviderConverter implements Converter {
                // Trace message
                this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N
 
-               // Get full list
-               List<SmsProvider> providerList = this.providerController.allSmsProvider();
-
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Trace message
@@ -87,6 +84,9 @@ public class SmsProviderConverter implements Converter {
                        return null;
                }
 
+               // Get full list
+               List<SmsProvider> providerList = this.providerController.allSmsProvider();
+
                // Init value
                SmsProvider provider = null;