jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1644) make NamespaceContext#getPrefix(java.lang.String) iterative instead of recursive
Date Wed, 30 Jul 2008 14:45:31 GMT

    [ https://issues.apache.org/jira/browse/JCR-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618366#action_12618366

Jukka Zitting commented on JCR-1644:

The stack overflows on NamespaceContext should really only be caused by excessively nested
XML elements (at least hundredths, probably thousands, of levels of nesting). If this happens
on documents with less than 100 levels of nesting, then I suspect that there's something else
wrong with the code; like the NamespaceContext stack not being correctly rewound.

I tried reviewing the related code, but couldn't find any obvious errors. Could you perhaps
send me a troublesome XML document or come up with a cleaned up example that illustrates the
problem? It's not high priority as it seems like the issue is already solved by the patch,
but I'd rather verify that we actually fixed the root cause instead of just working around

> make NamespaceContext#getPrefix(java.lang.String) iterative instead of recursive
> --------------------------------------------------------------------------------
>                 Key: JCR-1644
>                 URL: https://issues.apache.org/jira/browse/JCR-1644
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core, xml
>    Affects Versions: core 1.4.5
>            Reporter: Philippe Marschall
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.5
>         Attachments: JCR-1644-patch.diff, NamespaceContext.java, NamespaceContext.java.patch
> Currently the method org.apache.jackrabbit.core.xml.NamespaceContext#getPrefix(java.lang.String)
uses recursion. For very large XML files (50 MB Magnolia website exports) this causes a stack
overflow. The method can easily be rewritten using iteration.

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

View raw message