[jsword-devel] v11n patch - some non-KJV versified passages can not be read

John Austin gpl.programs.info at gmail.com
Mon Oct 29 19:58:04 MST 2012


A patch for JSword is attached. The Verse class was not maintaining
its own versification value and so it was impossible for Verse to
operate properly in some circumstances. This ultimately led to
unhandled exceptions when reading certain passages from non-default
versified Bibles such as IBT's UZV module, Ps 117:1-29 with Bible
Desktop.

The crux of the problem is seen in:
org.crosswire.jsword.passage.
Passage.getPassage(Key),
where Passage maintains its own versification value, but (Verse) Key
did not. So it was impossible to insure correct construction of a
Passage from an arbitrary Verse Key (all Passages returned were being
KJV versified even if the Verse was not KJV). This led to incorrect
Passage assignments and unhandled exceptions (such as when viewing
IBT's UZV module Ps 117:1-29).

The solution is pretty easy- require a Versification when
instantiating any Verse class, and then retain that value within the
Verse key. A method was added called Verse.getVersification(). Also,
to fix the above mentioned bug, Passage.getPassage(Key) now casts the
Key as Verse, and if successful, it reads the Verse's Versification to
pass it along to PassageKeyFactory.getKey(), thus enabling the
resulting Passage to have the correct Versification and value.

This fix is also logically necessary since Verse points to an actual
Bible verse, and the versification is a necessary part of any actual
Bible address location.

I tested this patch with common-junit-alltests and everything passed
expect 4 failures related to Lucene stemming and stop-words. These
seem to be related to the Lucene version and appear totally unrelated
related to Verse Key. I also tested a bit with Bible-Desktop.

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20121030/7dea9bff/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jsword-patch-vkey.diff
Type: text/x-patch
Size: 37507 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20121030/7dea9bff/attachment-0001.bin>


More information about the jsword-devel mailing list