Mercurial > hg > jdk9-shenandoah > jaxp
changeset 488:84a2b2ee6fc6
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 | 4c84c5b447b0 |
children | f031b2fe21cd |
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 Thu Sep 26 10:43:25 2013 -0700 +++ 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++; }