Author: violetagg
Date: Fri May 16 12:19:05 2014
New Revision: 1595174
URL: http://svn.apache.org/r1595174
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56529
Merged revision 1595171 from tomcat/trunk:
Fixed NoSuchElementException while handling attributes with empty string value
in custom tags. Patch provided by Hariprasad Manchi.
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/Validator.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1595171
Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/Validator.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/Validator.java?rev=1595174&r1=1595173&r2=1595174&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/Validator.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/Validator.java Fri May
16 12:19:05 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/tc7.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1595174&r1=1595173&r2=1595174&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri May 16 12:19:05 2014
@@ -215,6 +215,11 @@
by <code>{</code> in order for the back-slash escaping to take effect.
(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="Cluster">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]