Adjust usage of the factory

This commit is contained in:
Lukasz Lenart
2017-03-10 08:40:24 +01:00
parent db8ebe710d
commit 728055dc46
8 changed files with 54 additions and 27 deletions
@@ -52,11 +52,8 @@ public class I18NAttributeEvaluator extends AbstractAttributeEvaluator {
throw new ConfigurationException("There is no ActionContext for current request!");
}
TextProviderFactory tpf = new TextProviderFactory();
ctx.getContainer().inject(tpf);
LocaleProvider localeProvider = ctx.getContainer().getInstance(LocaleProvider.class);
TextProvider textProvider = tpf.createInstance(ctx.getActionInvocation().getAction().getClass(), localeProvider);
TextProviderFactory tpf = ctx.getContainer().inject(TextProviderFactory.class);
TextProvider textProvider = tpf.createInstance(ctx.getActionInvocation().getAction().getClass());
if (textProvider != null) {
LOG.debug("Trying find text [{}] using TextProvider {}", expression, textProvider);