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 2002/09/17 23:08:52 UTC

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

zongaro     2002/09/17 14:08:52

  Modified:    java/src/org/apache/xalan/xsltc/dom Tag: XSLTC_DTM
                        KeyIndex.java
  Log:
  Code in lookupId was getting garbage _nodes from previous calls in the case
  where argument was a whitespace-separated list of ID values.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.7.10.2  +22 -18    xml-xalan/java/src/org/apache/xalan/xsltc/dom/KeyIndex.java
  
  Index: KeyIndex.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/KeyIndex.java,v
  retrieving revision 1.7.10.1
  retrieving revision 1.7.10.2
  diff -u -r1.7.10.1 -r1.7.10.2
  --- KeyIndex.java	17 Apr 2002 18:13:44 -0000	1.7.10.1
  +++ KeyIndex.java	17 Sep 2002 21:08:52 -0000	1.7.10.2
  @@ -137,23 +137,27 @@
        * key() function.
        */
       public void lookupId(Object value) {
  -	if (value instanceof String) {
  -	    final String string = (String)value;
  -	    if (string.indexOf(' ') > -1) {
  -		StringTokenizer values = new StringTokenizer(string);
  -		while (values.hasMoreElements()) {
  -		    BitArray nodes = (BitArray)_index.get(values.nextElement());
  -		    if (nodes != null) {
  -			if (_nodes == null)
  -			    _nodes = nodes;
  -			else
  -			    _nodes = _nodes.merge(nodes);
  -		    }
  -		}
  -		return;
  -	    }
  -	}
  -	_nodes = (BitArray)_index.get(value);
  +        if (value instanceof String) {
  +            boolean firstTime = true;
  +            final String string = (String)value;
  +
  +            if (string.indexOf(' ') > -1) {
  +                StringTokenizer values = new StringTokenizer(string);
  +                while (values.hasMoreElements()) {
  +                    BitArray nodes = (BitArray)_index.get(values.nextElement());
  +                    if (nodes != null) {
  +                        if (firstTime) {
  +                            _nodes = nodes;
  +                            firstTime = false;
  +                        } else {
  +                            _nodes = _nodes.merge(nodes);
  +                        }
  +                    }
  +                }
  +                return;
  +            }
  +        }
  +        _nodes = (BitArray)_index.get(value);
       }
   
       /**
  
  
  

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