xml-xalan-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mk...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/dom SAXImpl.java
Date Wed, 15 Oct 2003 17:49:38 GMT
mkwan       2003/10/15 10:49:38

  Modified:    java/src/org/apache/xalan/xsltc/dom SAXImpl.java
  Log:
  Fix the makeNode and makeNodeList methods in SAXImpl for bugzilla 23115.
  
  Revision  Changes    Path
  1.11      +24 -9     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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SAXImpl.java	10 Oct 2003 18:42:53 -0000	1.10
  +++ SAXImpl.java	15 Oct 2003 17:49:38 -0000	1.11
  @@ -82,7 +82,6 @@
   import org.apache.xml.dtm.DTMManager;
   import org.apache.xml.dtm.DTMWSFilter;
   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;
  @@ -321,9 +320,17 @@
               _nodes = new Node[_namesSize];
           }
   
  -        return (_nodes[index] != null)
  -                    ? _nodes[index]
  -                    : (_nodes[index] = new DTMNodeProxy((DTM)this, index));
  +        int nodeID = makeNodeIdentity(index);
  +        if (nodeID < 0) {
  +            return null;
  +        }
  +        else if (nodeID < _nodes.length) {
  +            return (_nodes[nodeID] != null) ? _nodes[nodeID] 
  +                : (_nodes[nodeID] = new DTMNodeProxy((DTM)this, index));
  +        }
  +        else {
  +            return new DTMNodeProxy((DTM)this, index);
  +        }
       }
   
       /**
  @@ -341,11 +348,19 @@
           if (_nodeLists == null) {
               _nodeLists = new NodeList[_namesSize];
           }
  -        return (_nodeLists[index] != null)
  -                 ? _nodeLists[index]
  -                 : (_nodeLists[index] =
  -                         new DTMAxisIterNodeList(this,
  +        
  +        int nodeID = makeNodeIdentity(index);
  +        if (nodeID < 0) {
  +            return null;
  +        }
  +        else if (nodeID < _nodeLists.length) {
  +            return (_nodeLists[nodeID] != null) ? _nodeLists[nodeID]
  +                   : (_nodeLists[nodeID] = new DTMAxisIterNodeList(this,
                                                    new SingletonIterator(index)));
  +    }
  +        else {
  +            return new DTMAxisIterNodeList(this, new SingletonIterator(index));
  +        }
       }
   
       /**
  
  
  

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


Mime
View raw message