When the Jasper code gets the setter method for tag properties, it doesn't
check to see whether the m variable is null until after attempting to use its
getParameterTypes() method, which throws an uninformative NullPointerException. 
I simply moved the null check immediately after the variable m is set.

--- TagBeginGenerator.java.orig Wed Dec 13 12:18:12 2000
+++ TagBeginGenerator.java      Wed Dec 13 12:18:16 2000
@@ -193,6 +193,11 @@
                 if (attrValue != null) {
                    String attrName = attributes[i].getName();
                    Method m = tc.getSetterMethod(attrName);
+                   if (m == null)
+                       throw new CompileException
+                           (start, Constants.getString
+                            ("jsp.error.unable.to_find_method",
+                             new Object[] { attrName }));
                     Class c[] = m.getParameterTypes();
                     // assert(c.length > 0)
 
@@ -203,13 +208,6 @@
                             attrValue = convertString(c[0], attrValue, writer, 
attrName);
                    } else
                        attrValue = convertString(c[0], attrValue, writer, attrName);
-
-
-                   if (m == null)
-                       throw new CompileException
-                           (start, Constants.getString
-                            ("jsp.error.unable.to_find_method",
-                             new Object[] { attrName }));
 
                    writer.println(thVarName+"."+m.getName()+"("+attrValue+");");
                 }
---
              bitBull makes the Internet bite: http://www.bitBull.com/demos/

Reply via email to