[jboss-cvs] JBossAS SVN: r65891 - projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Oct 5 12:36:04 EDT 2007
Author: alesj
Date: 2007-10-05 12:36:04 -0400 (Fri, 05 Oct 2007)
New Revision: 65891
Modified:
projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/ReflectionUtils.java
Log:
Handle null array for info.
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/ReflectionUtils.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/ReflectionUtils.java 2007-10-05 16:25:40 UTC (rev 65890)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/ReflectionUtils.java 2007-10-05 16:36:04 UTC (rev 65891)
@@ -189,6 +189,18 @@
}
/**
+ * Get array info.
+ * Handle null parameter.
+ *
+ * @param objects the array of objects
+ * @return info
+ */
+ protected static Object arrayInfo(Object... objects)
+ {
+ return objects == null ? "<null>" : Arrays.asList(objects);
+ }
+
+ /**
* Find the method by name and parameters.
*
* @param clazz the class to look for method
@@ -225,7 +237,7 @@
{
Method method = findMethod(clazz, name, parameterTypes);
if (method == null)
- throw new NoSuchMethodException(clazz + "." + name + " - " + Arrays.asList(parameterTypes));
+ throw new NoSuchMethodException(clazz + "." + name + " - " + arrayInfo(parameterTypes));
return method;
}
@@ -303,7 +315,7 @@
{
Constructor constructor = findConstructor(clazz, parameterTypes);
if (constructor == null)
- throw new NoSuchMethodException(clazz + " - " + Arrays.asList(parameterTypes));
+ throw new NoSuchMethodException(clazz + " - " + arrayInfo(parameterTypes));
return constructor;
}
More information about the jboss-cvs-commits
mailing list