tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r1155985 - /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/CommonResourcesInjectionProvider.java
Date Wed, 10 Aug 2011 00:51:07 GMT
Author: hlship
Date: Wed Aug 10 00:51:07 2011
New Revision: 1155985

URL: http://svn.apache.org/viewvc?rev=1155985&view=rev
Log:
Streamline the initialization of ComponentResourcesInjectionProvider

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/CommonResourcesInjectionProvider.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/CommonResourcesInjectionProvider.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/CommonResourcesInjectionProvider.java?rev=1155985&r1=1155984&r2=1155985&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/CommonResourcesInjectionProvider.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/CommonResourcesInjectionProvider.java
Wed Aug 10 00:51:07 2011
@@ -111,12 +111,17 @@ public class CommonResourcesInjectionPro
     private static final Map<String, ResourceProvider> configuration = CollectionFactory.newMap();
 
     {
-        configuration.put(ComponentResources.class.getName(), resourcesProvider);
-        configuration.put(ComponentResourceSelector.class.getName(), selectorProvider);
-        configuration.put(Messages.class.getName(), messagesProvider);
-        configuration.put(Locale.class.getName(), localeProvider);
-        configuration.put(Logger.class.getName(), loggerProvider);
-        configuration.put(String.class.getName(), completeIdProvider);
+        add(ComponentResources.class, resourcesProvider);
+        add(ComponentResourceSelector.class, selectorProvider);
+        add(Messages.class, messagesProvider);
+        add(Locale.class, localeProvider);
+        add(Logger.class, loggerProvider);
+        add(String.class, completeIdProvider);
+    }
+
+    private static void add(Class type, ResourceProvider provider)
+    {
+        configuration.put(type.getName(), provider);
     }
 
     public boolean provideInjection(PlasticField field, ObjectLocator locator, MutableComponentModel
componentModel)



Mime
View raw message