Author: kkolinko Date: Fri May 16 22:02:47 2014 New Revision: 1595366 URL: http://svn.apache.org/r1595366 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56529 Merged r1595289 from tomcat/trunk: Review of r1595174: 1. Call iterator() once. It creates an object, so it is better do not waste such calls. 2. Style issues: - "" does not make sense as 'generic' default for textAttributeValue. It makes sense for this specific case only. - 3 spaces indent -> 4 spaces
Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/Validator.java Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1595289 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=1595366&r1=1595365&r2=1595366&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 22:02:47 2014 @@ -1124,12 +1124,16 @@ 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 - if(el.iterator().hasNext()) { - 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; } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org