8024707: TransformerException : item() return null with node list of length != 1
Reviewed-by: joehw, lancea
--- a/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java Wed Jul 05 19:14:19 2017 +0200
+++ b/jaxp/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++;
}