kstaken     02/01/21 12:49:47

  Modified:    java/src/org/apache/xindice/xml/dom NodeListImpl.java
  Log:
  Fixing behavior of NodeList.item for out of bounds results
  Submitted by: Mike Gratton
  Reviewed by: Kimbro Staken
  
  Revision  Changes    Path
  1.2       +7 -2      
xml-xindice/java/src/org/apache/xindice/xml/dom/NodeListImpl.java
  
  Index: NodeListImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/dom/NodeListImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NodeListImpl.java 6 Dec 2001 19:34:00 -0000       1.1
  +++ NodeListImpl.java 21 Jan 2002 20:49:47 -0000      1.2
  @@ -56,7 +56,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
  - * $Id: NodeListImpl.java,v 1.1 2001/12/06 19:34:00 bradford Exp $
  + * $Id: NodeListImpl.java,v 1.2 2002/01/21 20:49:47 kstaken Exp $
    */
   
   import org.w3c.dom.*;
  @@ -83,7 +83,12 @@
       *   index.
       */
      public final Node item(int index) {
  -      return (Node)get(index);
  +      try {
  +       return (Node)get(index);
  +      }
  +      catch (IndexOutOfBoundsException ioobe) {
  +       return null;
  +      }
      }
   
      /**
  
  
  

Reply via email to