You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by vi...@apache.org on 2014/05/16 14:07:08 UTC
svn commit: r1595171 - in /tomcat/trunk:
java/org/apache/jasper/compiler/Validator.java webapps/docs/changelog.xml
Author: violetagg
Date: Fri May 16 12:07:08 2014
New Revision: 1595171
URL: http://svn.apache.org/r1595171
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56529
Fixed NoSuchElementException while handling attributes with empty string value in custom tags. Patch provided by Hariprasad Manchi.
Modified:
tomcat/trunk/java/org/apache/jasper/compiler/Validator.java
tomcat/trunk/webapps/docs/changelog.xml
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=1595171&r1=1595170&r2=1595171&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Validator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Validator.java Fri May 16 12:07:08 2014
@@ -1124,14 +1124,15 @@ class Validator {
// When attribute is not an expression,
// contains its textual value with \$ and \# escaping removed.
- String textAttributeValue;
+ String textAttributeValue = "";
if (!elExpression && el != null) {
// Should be a single Text node
- textAttributeValue = ((ELNode.Text) el.iterator().next()).getText();
+ if(el.iterator().hasNext()) {
+ textAttributeValue = ((ELNode.Text) el.iterator().next()).getText();
+ }
} 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/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1595171&r1=1595170&r2=1595171&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri May 16 12:07:08 2014
@@ -70,6 +70,11 @@
place such as a <code>null</code> string being coerced to an empty
string. (markt)
</fix>
+ <fix>
+ <bug>56529</bug>: Avoid <code>NoSuchElementException</code> while handling
+ attributes with empty string value in custom tags. Patch provided by
+ Hariprasad Manchi. (violetagg)
+ </fix>
</changelog>
</subsection>
<subsection name="Other">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org