jon 00/11/25 10:27:27
Modified: src/java/org/apache/velocity/util/introspection
Introspector.java
Log:
a bit more debugging instead of an NPE
Revision Changes Path
1.8 +7 -4
jakarta-velocity/src/java/org/apache/velocity/util/introspection/Introspector.java
Index: Introspector.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/util/introspection/Introspector.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Introspector.java 2000/11/25 00:00:06 1.7
+++ Introspector.java 2000/11/25 18:27:27 1.8
@@ -59,6 +59,8 @@
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import org.apache.velocity.util.StringUtils;
+
/**
* This basic function of this class is to return a Method
* object for a particular class given the name of a method
@@ -83,7 +85,7 @@
* and stored for
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Bob McWhirter</a>
- * @version $Id: Introspector.java,v 1.7 2000/11/25 00:00:06 jon Exp $
+ * @version $Id: Introspector.java,v 1.8 2000/11/25 18:27:27 jon Exp $
*/
// isAssignable checks for arguments that are subclasses
@@ -97,10 +99,12 @@
public static Method getMethod(Class c, String name, Object[] params)
throws Exception
{
+ if (c == null)
+ throw new Exception ( "Introspector.getMethod(): Class method key was
null: " + name );
+
// If this is the first time seeing this class
// then create a method map for this class and
// store it in Hashtable of class method maps.
-
if (!classMethodMaps.containsKey(c))
{
// Lots of threads might be whizzing through here,
@@ -114,7 +118,7 @@
// multi-proc machines. Doesn't make things worse,
// but just doesn't help as much as you'd imagine it
// would. Darn re-ordering of instructions.
-
+
synchronized (classMethodMaps)
{
if (!classMethodMaps.containsKey(c))
@@ -123,7 +127,6 @@
}
}
}
-
return findMethod(c, name, params);
}