This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push: new cb2e625 Fix use of useInstanceManagerForTags with Tags that are inner classes cb2e625 is described below commit cb2e625b55e66d55452b9e67d98b5ec5727f8754 Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Apr 21 15:22:11 2021 +0100 Fix use of useInstanceManagerForTags with Tags that are inner classes --- java/org/apache/jasper/compiler/Generator.java | 11 ++++++----- webapps/docs/changelog.xml | 5 +++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java index 1fd19d9..b7ad241 100644 --- a/java/org/apache/jasper/compiler/Generator.java +++ b/java/org/apache/jasper/compiler/Generator.java @@ -2403,7 +2403,7 @@ class Generator { out.print(tagHandlerVar); out.println("_reused = false;"); } else { - writeNewInstance(tagHandlerVar, tagHandlerClassName); + writeNewInstance(tagHandlerVar, tagHandlerClass); } // Wrap use of tag in try/finally to ensure clean-up takes place @@ -2480,7 +2480,8 @@ class Generator { n.setEndJavaLine(out.getJavaLine()); } - private void writeNewInstance(String tagHandlerVar, String tagHandlerClassName) { + private void writeNewInstance(String tagHandlerVar, Class<?> tagHandlerClass) { + String tagHandlerClassName = tagHandlerClass.getCanonicalName(); out.printin(tagHandlerClassName); out.print(" "); out.print(tagHandlerVar); @@ -2490,7 +2491,8 @@ class Generator { out.print(tagHandlerClassName); out.print(")"); out.print("_jsp_getInstanceManager().newInstance(\""); - out.print(tagHandlerClassName); + // Need the binary name here, not the canonical name + out.print(tagHandlerClass.getName()); out.println("\", this.getClass().getClassLoader());"); } else { out.print("new "); @@ -2647,8 +2649,7 @@ class Generator { // Declare AT_END scripting variables declareScriptingVars(n, VariableInfo.AT_END); - String tagHandlerClassName = tagHandlerClass.getCanonicalName(); - writeNewInstance(tagHandlerVar, tagHandlerClassName); + writeNewInstance(tagHandlerVar, tagHandlerClass); out.printil("try {"); out.pushIndent(); diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index dc81afa..e92e1a7 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -145,6 +145,11 @@ makes it possible to define a <code><jsp-file></code> that will not be loaded at start-up. (markt) </update> + <fix> + Allow the JSP configuration option + <code>useInstanceManagerForTags</code> to be used with Tags that are + implemented as inner classes. (markt) + </fix> </changelog> </subsection> <subsection name="Web applications"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org