tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r740675 - /tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
Date Wed, 04 Feb 2009 10:26:29 GMT
Author: markt
Date: Wed Feb  4 10:26:28 2009
New Revision: 740675

URL: http://svn.apache.org/viewvc?rev=740675&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=38197
Take account of jsp:attribute elements when naming tag pools

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/Generator.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Generator.java?rev=740675&r1=740674&r2=740675&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Wed Feb  4 10:26:28 2009
@@ -43,6 +43,7 @@
 import org.apache.jasper.Constants;
 import org.apache.jasper.JasperException;
 import org.apache.jasper.JspCompilationContext;
+import org.apache.jasper.compiler.Node.NamedAttribute;
 import org.apache.jasper.runtime.JspRuntimeLibrary;
 import org.xml.sax.Attributes;
 
@@ -267,8 +268,8 @@
 
                 if (!n.implementsSimpleTag()) {
                     String name = createTagHandlerPoolName(n.getPrefix(), n
-                            .getLocalName(), n.getAttributes(), n
-                            .hasEmptyBody());
+                            .getLocalName(), n.getAttributes(), 
+                            n.getNamedAttributeNodes(), n.hasEmptyBody());
                     n.setTagHandlerPoolName(name);
                     if (!names.contains(name)) {
                         names.add(name);
@@ -284,15 +285,21 @@
              * @return The name of the tag handler pool
              */
             private String createTagHandlerPoolName(String prefix,
-                    String shortName, Attributes attrs, boolean hasEmptyBody) {
+                    String shortName, Attributes attrs, Node.Nodes namedAttrs,
+                    boolean hasEmptyBody) {
                 String poolName = null;
 
                 poolName = "_jspx_tagPool_" + prefix + "_" + shortName;
                 if (attrs != null) {
-                    String[] attrNames = new String[attrs.getLength()];
+                    String[] attrNames =
+                        new String[attrs.getLength() + namedAttrs.size()];
                     for (int i = 0; i < attrNames.length; i++) {
                         attrNames[i] = attrs.getQName(i);
                     }
+                    for (int i = 0; i < namedAttrs.size(); i++) {
+                        attrNames[attrs.getLength() + i] =
+                            ((NamedAttribute) namedAttrs.getNode(i)).getQName();
+                    }
                     Arrays.sort(attrNames, Collections.reverseOrder());
                     if (attrNames.length > 0) {
                         poolName = poolName + "&";



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


Mime
View raw message