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
jsword-patch-vkey.diff
Description: Binary data
_______________________________________________ sword-devel mailing list: sword-devel@crosswire.org http://www.crosswire.org/mailman/listinfo/sword-devel Instructions to unsubscribe/change your settings at above page