zongaro     2003/04/16 13:58:49

  Modified:    java/src/org/apache/xalan/xsltc/dom SAXImpl.java
               java/src/org/apache/xml/dtm/ref DTMAxisIteratorBase.java
  Added:       java/src/org/apache/xml/dtm/ref EmptyIterator.java
  Log:
  Applying patches from Igor Hersht ([EMAIL PROTECTED]) for bug 15200 and
  bug 18585.
  
  Pulled EmptyIterator class out of SAXImpl to allow for more widespread use.
  
  Revision  Changes    Path
  1.6       +3 -14     
xml-xalan/java/src/org/apache/xalan/xsltc/dom/SAXImpl.java
  
  Index: SAXImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/SAXImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SAXImpl.java      7 Apr 2003 19:23:15 -0000       1.5
  +++ SAXImpl.java      16 Apr 2003 20:58:49 -0000      1.6
  @@ -82,6 +82,7 @@
   import org.apache.xml.dtm.ref.DTMAxisIterNodeList;
   import org.apache.xml.dtm.ref.DTMAxisIteratorBase;
   import org.apache.xml.dtm.ref.DTMDefaultBase;
  +import org.apache.xml.dtm.ref.EmptyIterator;
   import org.apache.xml.dtm.ref.DTMNodeProxy;
   import org.apache.xml.dtm.ref.sax2dtm.SAX2DTM2;
   import org.apache.xml.serializer.SerializationHandler;
  @@ -146,19 +147,7 @@
       private final static String EMPTYSTRING = "";
   
       // empty iterator to be returned when there are no children
  -    private final static DTMAxisIterator EMPTYITERATOR =
  -        new DTMAxisIteratorBase() {
  -            public DTMAxisIterator reset() { return this; }
  -            public DTMAxisIterator setStartNode(int node) { return this; }
  -            public int next() { return DTM.NULL; }
  -            public void setMark() {}
  -            public void gotoMark() {}
  -            public int getLast() { return 0; }
  -            public int getPosition() { return 0; }
  -            public DTMAxisIterator cloneIterator() { return this; }
  -            public void setRestartable(boolean isRestartable) { }
  -        };
  -    
  +    private final static DTMAxisIterator EMPTYITERATOR = 
EmptyIterator.getInstance();
       // The number of expanded names
       private int _namesSize = 0;
   
  
  
  
  1.9       +2 -1      
xml-xalan/java/src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
  
  Index: DTMAxisIteratorBase.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DTMAxisIteratorBase.java  1 Apr 2003 19:14:04 -0000       1.8
  +++ DTMAxisIteratorBase.java  16 Apr 2003 20:58:49 -0000      1.9
  @@ -59,7 +59,8 @@
   import org.apache.xml.dtm.DTMAxisIterator;
   
   /**
  - * This class serves as a default base for implementations of 
DTMAxisIterators.
  + * This class serves as a default base for implementations of mutable
  + * DTMAxisIterators.
    */
   public abstract class DTMAxisIteratorBase implements DTMAxisIterator
   {
  
  
  
  1.1                  
xml-xalan/java/src/org/apache/xml/dtm/ref/EmptyIterator.java
  
  Index: EmptyIterator.java
  ===================================================================
  
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:  
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Xalan" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written 
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation and was
   * originally based on software copyright (c) 1999, Lotus
   * Development Corporation., http://www.lotus.com.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.xml.dtm.ref;
  
  import org.apache.xml.dtm.DTMAxisIterator;
  import org.apache.xml.dtm.DTM;
  
  
  /**
   * DTM Empty Axis Iterator. The class is immutable
   */
  public final class EmptyIterator implements DTMAxisIterator
  {
    private static final EmptyIterator INSTANCE =  new EmptyIterator();
    
    public static DTMAxisIterator  getInstance() {return INSTANCE;}
    
    private EmptyIterator(){}
    
    public final  int  next(){ return END; }  
    
    public final DTMAxisIterator reset(){ return this; }
  
    public final int getLast(){ return 0; }
  
    public final int getPosition(){ return 1; }
  
    public final void setMark(){}
  
    public final void gotoMark(){}
  
    public final DTMAxisIterator setStartNode(int node){ return this; }
  
    public final int getStartNode(){ return END; } 
    
    public final boolean isReverse(){return false;} 
    
    public final DTMAxisIterator cloneIterator(){ return this; }
    
    public final void setRestartable(boolean isRestartable) {}
    
    public final int getNodeByPosition(int position){ return END; } 
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to