changeset 852:9d261303a659

8024707: TransformerException : item() return null with node list of length != 1 Reviewed-by: joehw, lancea
author aefimov
date Tue, 01 Oct 2013 17:14:08 +0400
parents 7ad0e91a96b2
children 5ea5b94af7d7 c62352b6670e
files src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java	Mon Sep 23 12:07:53 2013 +0100
+++ b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java	Tue Oct 01 17:14:08 2013 +0400
@@ -105,15 +105,15 @@
      */
     public Node item(int index) {
         if (m_iter != null) {
-            int node;
+            int node = 0;
             int count = m_cachedNodes.size();
 
             if (count > index) {
                 node = m_cachedNodes.elementAt(index);
                 return m_dtm.getNode(node);
             } else if (m_last == -1) {
-                while (((node = m_iter.next()) != DTMAxisIterator.END)
-                           && count <= index) {
+                while (count <= index
+                        && ((node = m_iter.next()) != DTMAxisIterator.END)) {
                     m_cachedNodes.addElement(node);
                     count++;
                 }