[jsword-devel] [JIRA] Commented: (JS-182) GenBookBackend problem in contains(Key)
DM Smith (JIRA)
jira at crosswire.org
Thu Mar 17 05:35:16 MST 2011
[ http://www.crosswire.org/bugs/browse/JS-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14140#comment-14140 ]
DM Smith commented on JS-182:
-----------------------------
The way it was written was consistent with how the backend for a Bible was written. For Bibles a module may have empty spots in the index for a verse. For example, a NT with only Matt will only have valid Matt verses but will have entries in the index for every other verse in the NT versification. Those won't point to anywhere valid. The check there is first to see if the index entry makes sense and second to see if it points to something that has content.
Given that the GenBookBackend is also used for Bibles with TreeKey, this might be a concern. (None are released so far, and only are experimental.) Contains(key) should return false for Bibles when the content is empty.
> GenBookBackend problem in contains(Key)
> ---------------------------------------
>
> Key: JS-182
> URL: http://www.crosswire.org/bugs/browse/JS-182
> Project: JSword
> Issue Type: Bug
> Components: o.c.jsword.book.sword
> Affects Versions: 1.6
> Reporter: DM Smith
> Assignee: DM Smith
> Fix For: 1.6.1
>
>
> GenBookBackend's boolean contains(Key) does not return true for every key returned by Key readIndex().
> The problem is that some keys (interior nodes) have no text associated with them. The method contains(Key) tests to see if there is data associated with the key. It should just test either
> * that it is a valid node or
> * that it is an interior node with children or a leaf node with content.
> Either way a node that returns false should not be in the result of readIndex.
> Given that getRawText(Key) will return "" for such keys, I think the first way is most reasonable.
> Looking at the code, I can't see where the current behavior is relied upon.
--
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