You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2011/09/26 22:19:20 UTC

svn commit: r1176021 - in /tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal: IOCMessages.java RegistryImpl.java

Author: hlship
Date: Mon Sep 26 20:19:19 2011
New Revision: 1176021

URL: http://svn.apache.org/viewvc?rev=1176021&view=rev
Log:
TAP5-1670: Debug output includes [[invoking-method]] (i.e., missing message key) when invoking contribution methods

Modified:
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java?rev=1176021&r1=1176020&r2=1176021&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java Mon Sep 26 20:19:19 2011
@@ -23,6 +23,7 @@ import org.apache.tapestry5.ioc.internal
 import org.apache.tapestry5.ioc.internal.util.InternalUtils;
 import org.apache.tapestry5.ioc.internal.util.MessagesImpl;
 import org.apache.tapestry5.ioc.services.ClassFabUtils;
+import org.apache.tapestry5.plastic.PlasticUtils;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
@@ -96,12 +97,6 @@ final class IOCMessages
                 serviceInterface.getName());
     }
 
-    static String invokingMethod(ContributionDef def)
-    {
-        // The toString() of a contribution def is the name of the method.
-        return MESSAGES.format("invoking-method", def);
-    }
-
     static String recursiveServiceBuild(ServiceDef def)
     {
         return MESSAGES.format("recursive-service-build", def.getServiceId(), def.toString());
@@ -223,12 +218,9 @@ final class IOCMessages
 
     private static String toJavaClassNames(List<Class> classes)
     {
-        List<String> names = CollectionFactory.newList();
-
-        for (Class<?> clazz : classes)
-        {
-            names.add(ClassFabUtils.toJavaClassName(clazz));
-        }
+        Class[] asArray = classes.toArray(new Class[classes.size()]);
+        String[] namesArray = PlasticUtils.toTypeNames(asArray);
+        List<String> names = CollectionFactory.newList(namesArray);
 
         return InternalUtils.joinSorted(names);
     }

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java?rev=1176021&r1=1176020&r2=1176021&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java Mon Sep 26 20:19:19 2011
@@ -540,10 +540,9 @@ public class RegistryImpl implements Reg
             final MappedConfiguration<K, V> validating = new ValidatingMappedConfigurationWrapper<K, V>(valueType,
                     resources, typeCoercerProxy, map, overrides, serviceId, def, keyClass, keyToContribution);
 
-            String description = IOCMessages.invokingMethod(def);
+            String description = "Invoking " + def;
 
-            if (debug)
-                logger.debug(description);
+            logger.debug(description);
 
             operationTracker.run(description, new Runnable()
             {
@@ -575,10 +574,9 @@ public class RegistryImpl implements Reg
             final Configuration<T> validating = new ValidatingConfigurationWrapper<T>(valueType, resources,
                     typeCoercerProxy, collection, serviceId);
 
-            String description = IOCMessages.invokingMethod(def);
+            String description = "Invoking " + def;
 
-            if (debug)
-                logger.debug(description);
+            logger.debug(description);
 
             operationTracker.run(description, new Runnable()
             {
@@ -610,16 +608,14 @@ public class RegistryImpl implements Reg
             final OrderedConfiguration<T> validating = new ValidatingOrderedConfigurationWrapper<T>(valueType,
                     resources, typeCoercerProxy, orderer, overrides, def);
 
-            String description = IOCMessages.invokingMethod(def);
+            String description = "Invoking " + def;
 
-            if (debug)
-                logger.debug(description);
+            logger.debug(description);
 
             operationTracker.run(description, new Runnable()
             {
                 public void run()
                 {
-
                     def.contribute(module, resources, validating);
                 }
             });