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

Martin Denham (JIRA) jira at crosswire.org
Wed Mar 9 05:08:35 MST 2011


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