From f9d72ea3b929959483007afb02e60db4c38589dd Mon Sep 17 00:00:00 2001 From: markt Date: Thu, 8 Jul 2010 21:29:12 +0000 Subject: [PATCH] Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49555 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 | 15 +++++++++++++-- webapps/docs/changelog.xml | 4 ++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/java/org/apache/jasper/compiler/ELFunctionMapper.java b/java/org/apache/jasper/compiler/ELFunctionMapper.java index f12ffc023..53d931e73 100644 --- a/java/org/apache/jasper/compiler/ELFunctionMapper.java +++ b/java/org/apache/jasper/compiler/ELFunctionMapper.java @@ -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('$', '.'); + } } } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 632d1bdcc..120317370 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -149,6 +149,10 @@ Improve logging of JSP exceptions by including JSP snippet (if enabled) rather than just the root cause in the host log. (markt) + + 49555: Correctly handled Tag Libraries where functions are + defined in static inner classes. (markt) + -- 2.11.0