You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by zo...@apache.org on 2006/04/19 17:37:31 UTC

svn commit: r395279 - /xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/LiteralElement.java

Author: zongaro
Date: Wed Apr 19 08:37:31 2006
New Revision: 395279

URL: http://svn.apache.org/viewcvs?rev=395279&view=rev
Log:
Part of patch for XALANJ-1324 and others.

Removed code that was removing xsl:variable declarations from the list of
children of the LRE.   This caused problems with annotating LocalVariableGen
objects with the range of instructions over which the variable is actually
alive.  This is in support of method splitting and outlining.

See org.apache.xalan.xsltc.compiler.util.MethodGenerator.outlineChunks for more
information.

Patch reviewed by Christine Li and Erin Harris.

Modified:
    xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/LiteralElement.java

Modified: xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/LiteralElement.java
URL: http://svn.apache.org/viewcvs/xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/LiteralElement.java?rev=395279&r1=395278&r2=395279&view=diff
==============================================================================
--- xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/LiteralElement.java (original)
+++ xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/LiteralElement.java Wed Apr 19 08:37:31 2006
@@ -340,23 +340,14 @@
 	il.append(methodGen.startElement());
 
 	// The value of an attribute may depend on a (sibling) variable
-    int j=0;
-    while (j < elementCount())
-    {
-        final SyntaxTreeNode item = (SyntaxTreeNode) elementAt(j);
-        if (item instanceof Variable) {
-            item.translate(classGen, methodGen);
-            removeElement(item);	// avoid translating it twice
-            /* When removing an element we do not increment j
-             * but the removal will reduce the value of elementCount()
-             * so this loop WILL end. The next iteration will process
-             * elementAt(j), but with the old element removed
-             * we are actually processing the next element.
-             */
-	    }
-        else
+        int j=0;
+        while (j < elementCount())  {
+            final SyntaxTreeNode item = (SyntaxTreeNode) elementAt(j);
+            if (item instanceof Variable) {
+                item.translate(classGen, methodGen);
+            }
             j++;
-	}
+        }
 
 	// Compile code to emit namespace attributes
 	if (_accessedPrefixes != null) {



---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org