[jsword-devel] [JIRA] Commented: (JS-174) Infinite recursion getting osis id for a TreeKey

Martin Denham (JIRA) jira at crosswire.org
Sat Mar 12 07:27:24 MST 2011


    [ http://www.crosswire.org/bugs/browse/JS-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14113#comment-14113 ] 

Martin Denham commented on JS-174:
----------------------------------

I don't actually use treeKey.getOsisID now.  I use treeKey.getName instead but at the start of gen book coding I wasn't sure which ID to use in order to find a particular treeKey again so I tried both name and osisId.

I raised the bug because I saw the error but it is not affecting me.

> Infinite recursion getting osis id for a TreeKey
> ------------------------------------------------
>
>                 Key: JS-174
>                 URL: http://www.crosswire.org/bugs/browse/JS-174
>             Project: JSword
>          Issue Type: Bug
>          Components: o.c.jsword.passage
>    Affects Versions: 1.6.1
>         Environment: All
>            Reporter: Martin Denham
>            Assignee: DM Smith
>
> I am not sure if it makes sense to get an osis id for a TreeKey treeKey.getName works fine but when I tried treeKey.getOsisID it failed with some sort of infinite recursion error.  I wonder if the new java 5 for loop in KeyUtil.visit is causing a problem.
> Here is my test:
> 	Book book = getBook("Pilgrim");  // Bunyan's Pilgrim's Progress
> 	Key key = book.getKey("THE FIRST STAGE");
> 	key.getOsisID(); // error occurs here
> Here is the top of the stack trace:
> java.lang.StackOverflowError
> 	at java.util.Stack.peek(Stack.java:86)
> 	at org.crosswire.jsword.passage.KeyIterator.prepare(KeyIterator.java:49)
> 	at org.crosswire.jsword.passage.KeyIterator.hasNext(KeyIterator.java:63)
> 	at org.crosswire.jsword.passage.KeyIterator.next(KeyIterator.java:68)
> 	at org.crosswire.jsword.passage.KeyIterator.next(KeyIterator.java:36)
> 	at org.crosswire.jsword.passage.KeyUtil.visit(KeyUtil.java:50)
> 	at org.crosswire.jsword.passage.KeyUtil.visit(KeyUtil.java:53)
> 	at org.crosswire.jsword.passage.KeyUtil.visit(KeyUtil.java:53)
> 	at org.crosswire.jsword.passage.KeyUtil.visit(KeyUtil.java:53)
> 	at org.crosswire.jsword.passage.KeyUtil.visit(KeyUtil.java:53)
> 	at org.crosswire.jsword.passage.KeyUtil.visit(KeyUtil.java:53)
> 	at org.crosswire.jsword.passage.KeyUtil.visit(KeyUtil.java:53)
> 	at org.crosswire.jsword.passage.KeyUtil.visit(KeyUtil.java:53)
> // the calls to .visit go on and on...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the jsword-devel mailing list