empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1329230 - /empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesApplication.java
Date Mon, 23 Apr 2012 13:28:17 GMT
Author: doebele
Date: Mon Apr 23 13:28:17 2012
New Revision: 1329230

URL: http://svn.apache.org/viewvc?rev=1329230&view=rev
Log:
EMPIREDB-140
initTextResolvers default implementation changed

Modified:
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesApplication.java

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesApplication.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesApplication.java?rev=1329230&r1=1329229&r2=1329230&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesApplication.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesApplication.java
Mon Apr 23 13:28:17 2012
@@ -80,23 +80,8 @@ public abstract class FacesApplication e
     {
         // Check Text resolvers
         if (textResolvers==null)
-        {
-            log.info("TextResolvers not initialized. Using default.");
-            
-            int count = 0;
-            Iterator<Locale> locales = getSupportedLocales();
-            for (count=0; locales.hasNext(); count++) { locales.next(); }
-            
-            // get message bundles
-            String messageBundle = this.getMessageBundle();
-            textResolvers = new TextResolver[count];
-            locales = getSupportedLocales();
-            for (int i=0; locales.hasNext(); i++)
-            {
-                Locale locale = locales.next();
-                textResolvers[i] = new TextResolver(ResourceBundle.getBundle(messageBundle,
locale));
-            }
-        }
+            initTextResolvers();        
+
         // done
         log.info("FacesApplication initialization complete");
     }
@@ -257,9 +242,20 @@ public abstract class FacesApplication e
     /* Message handling */
     
     protected void initTextResolvers()
-    {
-        ResourceBundle rb = ResourceBundle.getBundle("lang.messages", Locale.getDefault());
-        textResolvers = new TextResolver[] { new TextResolver(rb) }; 
+    {        
+        int count = 0;
+        Iterator<Locale> locales = getSupportedLocales();
+        for (count=0; locales.hasNext(); count++) { locales.next(); }
+        
+        // get message bundles
+        String messageBundle = this.getMessageBundle();
+        textResolvers = new TextResolver[count];
+        locales = getSupportedLocales();
+        for (int i=0; locales.hasNext(); i++)
+        {
+            Locale locale = locales.next();
+            textResolvers[i] = new TextResolver(ResourceBundle.getBundle(messageBundle, locale));
+        }
     }
     
     public TextResolver getTextResolver(Locale locale)



Mime
View raw message