From ea364b0fb445c5d750a8d30d54d30a4d32778243 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 4 Mar 2016 21:44:53 +0100 Subject: [PATCH] Some performance tuning: get list only if submittedValue is set non-empty --- .../addressbook/converter/country/CountryConverter.java | 6 +++--- .../converter/smsprovider/SmsProviderConverter.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/java/org/mxchange/addressbook/converter/country/CountryConverter.java b/src/java/org/mxchange/addressbook/converter/country/CountryConverter.java index 63dc22c6..4f1dffaf 100644 --- a/src/java/org/mxchange/addressbook/converter/country/CountryConverter.java +++ b/src/java/org/mxchange/addressbook/converter/country/CountryConverter.java @@ -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 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 countryList = this.countryController.allCountries(); + // Init value Country country = null; diff --git a/src/java/org/mxchange/addressbook/converter/smsprovider/SmsProviderConverter.java b/src/java/org/mxchange/addressbook/converter/smsprovider/SmsProviderConverter.java index b22a8bc8..e67ec8e2 100644 --- a/src/java/org/mxchange/addressbook/converter/smsprovider/SmsProviderConverter.java +++ b/src/java/org/mxchange/addressbook/converter/smsprovider/SmsProviderConverter.java @@ -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 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 providerList = this.providerController.allSmsProvider(); + // Init value SmsProvider provider = null; -- 2.39.5