[ 
https://issues.apache.org/jira/browse/XALANJ-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972153#action_12972153
 ] 

Heikki Vesalainen edited comment on XALANJ-2169 at 12/16/10 12:39 PM:
----------------------------------------------------------------------

The problem is this method in 

MultiDOM

public NodeList makeNodeList(DTMAxisIterator iter) {
        // TODO: gather nodes from all DOMs ?
        return _main.makeNodeList(iter);
}

It uses the _mail always when it should use the DOM from which the iter is from.

I.e. it should probably be something like:

public NodeList makeNodeList(DTMAxisIterator iter) {
        // TODO: gather nodes from all DOMs ?
        if (iter instanceof MultiDOM.AxisIterator) {
           return _adapters[((MultiDOM.AxisIterator) 
iter)._dtmId].makeNodeList(iter);
        } else {
           return _main.makeNodeList(iter);
        }
}

disclaimer: this is the first time I had a look at Xalan code, so I might be 
completely off with my solution proposal.

      was (Author: hvesalai):
    The problem is this method in 

MultiDOM

public NodeList makeNodeList(DTMAxisIterator iter) {
        // TODO: gather nodes from all DOMs ?
        return _main.makeNodeList(iter);
}

It uses the _mail always when it should use the DOM from which the iter is from.
  
> Functions on Nodes in NodeList fail with 
> java.lang.ArrayIndexOutOfBoundsException: -1
> -------------------------------------------------------------------------------------
>
>                 Key: XALANJ-2169
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2169
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: DTM, Xalan, XSLTC
>    Affects Versions: 2.6
>         Environment: Java 1.4.2_06; Xalan 2.6.0; Xerces 2.6.2; Windows 2000
>            Reporter: Glen Blanchard
>         Attachments: booklist.xml, Extension.java, test.xsl
>
>
> When using an extension over a RTF converted to a NodeList using the nodeset 
> extension function, some methods on the Nodes in the NodeList throw and 
> java.lang.ArrayIndexOutOfBoundsException: -1
> Tracing through the code it comes down to the DTMDefaultBase.makeNodeIdentity 
> function returning a DTM.NULL because the nodeHandle passed in doesn't belong 
> to "this" DTMDefaultBase instance.
> Comment extracted from DTMDefaultBase:
> // %REVIEW% Wish I didn't have to perform the pre-test, but
> // someone is apparently asking DTMs whether they contain nodes
> // which really don't belong to them. That's probably a bug
> // which should be fixed, but until it is:
> if(m_mgrDefault.m_dtms[whichDTMindex]!=this)
>     return NULL;
> The full call path is:
> Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
>         at 
> org.apache.xml.utils.SuballocatedIntVector.elementAt(SuballocatedIntVector.java:438)
>         at 
> org.apache.xml.dtm.ref.DTMDefaultBase._firstch(DTMDefaultBase.java:526)
>         at 
> org.apache.xml.dtm.ref.DTMDefaultBase.getFirstChild(DTMDefaultBase.java:973)
>         at 
> org.apache.xml.dtm.ref.DTMNodeProxy.getFirstChild(DTMNodeProxy.java:370)
> Let me know if more detail is required as this is the last hurdle for a major 
> speed improvement.
> Thanks

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscr...@xml.apache.org
For additional commands, e-mail: xalan-dev-h...@xml.apache.org

Reply via email to