Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49555
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 8 Jul 2010 21:29:12 +0000 (21:29 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 8 Jul 2010 21:29:12 +0000 (21:29 +0000)
Correctly handle tag libraries that use functions defined in static inner classes

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@961948 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jasper/compiler/ELFunctionMapper.java
webapps/docs/changelog.xml

index f12ffc0..53d931e 100644 (file)
@@ -212,8 +212,8 @@ public class ELFunctionMapper {
                 FunctionInfo funcInfo = f.getFunctionInfo();
                 String key = f.getPrefix()+ ":" + f.getName();
                 ds.append(funcMethod + "(\"" + key + "\", " +
-                        funcInfo.getFunctionClass() + ".class, " +
-                        '\"' + f.getMethodName() + "\", " +
+                        getCanonicalName(funcInfo.getFunctionClass()) +
+                        ".class, " + '\"' + f.getMethodName() + "\", " +
                         "new Class[] {");
                 String params[] = f.getParameters();
                 for (int k = 0; k < params.length; k++) {
@@ -286,6 +286,17 @@ public class ELFunctionMapper {
         private String getMapName() {
             return "_jspx_fnmap_" + currFunc++;
         }
+
+        /**
+         * Convert a binary class name into a canonical one that can be used
+         * when generating Java source code.
+         * 
+         * @param className Binary class name
+         * @return          Canonical equivalent
+         */
+        private String getCanonicalName(String className) {
+            return className.replace('$', '.');
+        }
     }
 }
 
index 632d1bd..1203173 100644 (file)
         Improve logging of JSP exceptions by including JSP snippet (if enabled)
         rather than just the root cause in the host log. (markt)
       </add>
+      <fix>
+        <bug>49555</bug>: Correctly handled Tag Libraries where functions are
+        defined in static inner classes. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Cluster">