You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2018/09/23 15:27:13 UTC

svn commit: r1841757 - in /tomcat/trunk: java/org/apache/jasper/compiler/Validator.java test/org/apache/el/TestELInJsp.java test/webapp/WEB-INF/test.tld test/webapp/bug6nnnn/bug60431.jsp

Author: markt
Date: Sun Sep 23 15:27:13 2018
New Revision: 1841757

URL: http://svn.apache.org/viewvc?rev=1841757&view=rev
Log:
Fix a regression in the TLD whitespace parsing fix that broke parsing when whitespace was present between the method name and the opening '(' of the parameters.

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/Validator.java
    tomcat/trunk/test/org/apache/el/TestELInJsp.java
    tomcat/trunk/test/webapp/WEB-INF/test.tld
    tomcat/trunk/test/webapp/bug6nnnn/bug60431.jsp

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Validator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Validator.java?rev=1841757&r1=1841756&r2=1841757&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Validator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Validator.java Sun Sep 23 15:27:13 2018
@@ -423,7 +423,7 @@ class Validator {
     private static class ValidateVisitor extends Node.Visitor {
 
         // Pattern to extract a method name from a full method signature
-        private static final Pattern METHOD_NAME_PATTERN = Pattern.compile(".*[ \t\n\r]+(.+)[ \t\n\r]*\\(.*");
+        private static final Pattern METHOD_NAME_PATTERN = Pattern.compile(".*[ \t\n\r]+(.+?)[ \t\n\r]*\\(.*");
 
         private final PageInfo pageInfo;
 

Modified: tomcat/trunk/test/org/apache/el/TestELInJsp.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/TestELInJsp.java?rev=1841757&r1=1841756&r2=1841757&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/el/TestELInJsp.java (original)
+++ tomcat/trunk/test/org/apache/el/TestELInJsp.java Sun Sep 23 15:27:13 2018
@@ -507,6 +507,7 @@ public class TestELInJsp extends TomcatB
         String result = res.toString();
         assertEcho(result, "01-OK");
         assertEcho(result, "02-OK");
+        assertEcho(result, "03-OK");
     }
 
 

Modified: tomcat/trunk/test/webapp/WEB-INF/test.tld
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/WEB-INF/test.tld?rev=1841757&r1=1841756&r2=1841757&view=diff
==============================================================================
--- tomcat/trunk/test/webapp/WEB-INF/test.tld (original)
+++ tomcat/trunk/test/webapp/WEB-INF/test.tld Sun Sep 23 15:27:13 2018
@@ -48,4 +48,14 @@
     </function-signature>
   </function>
 
+  <function>
+    <name>toArrayB</name>
+    <function-class>org.apache.el.TesterFunctions</function-class>
+    <!-- Do not change whitespace in signature below.
+         It used to test for correctness in o.a.jasper.compiler.Validator. -->
+    <function-signature>
+      java.lang.String toArray (java.lang.String,java.lang.String)
+    </function-signature>
+  </function>
+
 </taglib>
\ No newline at end of file

Modified: tomcat/trunk/test/webapp/bug6nnnn/bug60431.jsp
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/bug6nnnn/bug60431.jsp?rev=1841757&r1=1841756&r2=1841757&view=diff
==============================================================================
--- tomcat/trunk/test/webapp/bug6nnnn/bug60431.jsp (original)
+++ tomcat/trunk/test/webapp/bug6nnnn/bug60431.jsp Sun Sep 23 15:27:13 2018
@@ -21,5 +21,6 @@
   <body>
     <tags:echo echo="${'01-' += fn:concat('O', 'K')}"/>
     <tags:echo echo="${'02-' += fn:concat(fn:toArray('O', 'K'))}"/>
+    <tags:echo echo="${'03-' += fn:concat(fn:toArrayB('O', 'K'))}"/>
   </body>
 </html>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org