Author: markt Date: Mon May 19 10:18:29 2014 New Revision: 1595816 URL: http://svn.apache.org/r1595816 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56529 Fix NoSuchElementException while handling attributes with empty string value in custom tags. Based on a patch provided by Hariprasad Manchi. (violetagg/kkolinko)
Modified: tomcat/tc6.0.x/trunk/ (props changed) tomcat/tc6.0.x/trunk/STATUS.txt tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Validator.java tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc6.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1595289 Merged /tomcat/tc7.0.x/trunk:r1595366 Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1595816&r1=1595815&r2=1595816&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Mon May 19 10:18:29 2014 @@ -28,19 +28,6 @@ None PATCHES PROPOSED TO BACKPORT: [ New proposals should be added at the end of the list ] -* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56529 - Fix NoSuchElementException while handling attributes with empty string value - in custom tags. Patch provided by Hariprasad Manchi. - http://svn.apache.org/viewvc?view=revision&revision=1595174 - +1: markt, fhanik, remm - +1: kkolinko (additional patch below) - -1: - - Additional patch: - http://svn.apache.org/viewvc?view=revision&revision=1595366 - +1: kkolinko, markt, violetagg - -1: - PATCHES/ISSUES THAT ARE STALLED: Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Validator.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Validator.java?rev=1595816&r1=1595815&r2=1595816&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Validator.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Validator.java Mon May 19 10:18:29 2014 @@ -1086,11 +1086,16 @@ class Validator { String textAttributeValue; if (!elExpression && el != null) { // Should be a single Text node - textAttributeValue = ((ELNode.Text) el.iterator().next()).getText(); + Iterator<ELNode> it = el.iterator(); + if (it.hasNext()) { + textAttributeValue = ((ELNode.Text) it.next()) + .getText(); + } else { + textAttributeValue = ""; + } } else { textAttributeValue = xmlAttributeValue; } - for (int j = 0; tldAttrs != null && j < tldAttrs.length; j++) { if (attrs.getLocalName(i).equals(tldAttrs[j].getName()) && (attrs.getURI(i) == null Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1595816&r1=1595815&r2=1595816&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Mon May 19 10:18:29 2014 @@ -43,7 +43,18 @@ <!-- Section names: General, Catalina, Coyote, Jasper, Cluster, Web applications, Other --> -<section name="Tomcat 6.0.40" rtext=""> +<section name="Tomcat 6.0.41" rtext=""> + <subsection name="Jasper"> + <changelog> + <fix> + <bug>56529</bug>: Avoid <code>NoSuchElementException</code> while handling + attributes with empty string value in custom tags. Based on a patch + provided by Hariprasad Manchi. (violetagg/kkolinko) + </fix> + </changelog> + </subsection> +</section> +<section name="Tomcat 6.0.40" rtext="not released"> <subsection name="Catalina"> <changelog> <fix> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org