You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by am...@apache.org on 2002/03/11 23:29:56 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/dom UnionIterator.java

amiro       02/03/11 14:29:56

  Modified:    java/src/org/apache/xalan/xsltc/compiler ApplyTemplates.java
               java/src/org/apache/xalan/xsltc/dom UnionIterator.java
  Log:
  fix 5573 for XSLTMark alphabetize test
  
  Revision  Changes    Path
  1.12      +5 -2      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ApplyTemplates.java
  
  Index: ApplyTemplates.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ApplyTemplates.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ApplyTemplates.java	1 Feb 2002 20:07:08 -0000	1.11
  +++ ApplyTemplates.java	11 Mar 2002 22:29:56 -0000	1.12
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: ApplyTemplates.java,v 1.11 2002/02/01 20:07:08 tmiller Exp $
  + * @(#)$Id: ApplyTemplates.java,v 1.12 2002/03/11 22:29:56 amiro Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -139,6 +139,7 @@
        * some template in the stylesheet uses parameters. 
        */
       public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  +	boolean setStartNodeCalled = false;
   	final Stylesheet stylesheet = classGen.getStylesheet();
   	final ConstantPoolGen cpg = classGen.getConstantPool();
   	final InstructionList il = methodGen.getInstructionList();
  @@ -165,6 +166,7 @@
   	    translateContents(classGen, methodGen);
   	}
   
  +
   	il.append(classGen.loadTranslet());
   
   	// The 'select' expression is a result-tree
  @@ -192,6 +194,7 @@
   							     NODE_ITERATOR_SIG);
   		il.append(methodGen.loadCurrentNode());
   		il.append(new INVOKEINTERFACE(setStartNode,2));
  +		setStartNodeCalled = true;	
   	    }
   	    else {
   		if (_select == null)
  @@ -201,7 +204,7 @@
   	    }
   	}
   
  -	if (_select != null) {
  +	if (_select != null && !setStartNodeCalled) {
   	    _select.startResetIterator(classGen, methodGen);
   	}
   
  
  
  
  1.11      +4 -2      xml-xalan/java/src/org/apache/xalan/xsltc/dom/UnionIterator.java
  
  Index: UnionIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/UnionIterator.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- UnionIterator.java	4 Dec 2001 10:30:07 -0000	1.10
  +++ UnionIterator.java	11 Mar 2002 22:29:56 -0000	1.11
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: UnionIterator.java,v 1.10 2001/12/04 10:30:07 morten Exp $
  + * @(#)$Id: UnionIterator.java,v 1.11 2002/03/11 22:29:56 amiro Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -152,8 +152,10 @@
   	    final int smallest = _heap[0].node;
   	    if (smallest == END) { // iterator _heap[0] is done
   		if (_heapSize > 1) {
  -		    // replace it with last
  +		    // Swap first and last (iterator must be restartable)
  +		    final LookAheadIterator temp = _heap[0];
   		    _heap[0] = _heap[--_heapSize];
  +		    _heap[_heapSize] = temp;
   		}
   		else {
   		    return END;
  
  
  

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