<div dir="ltr">Bible book names are currently looked up in Versification code but I am not sure this is correct because support for getting the name of a Bible book not in the versification is not provided?.<div><br></div>
<div>Versifications throw a NullPointerException if an attempt is made to get the name of a Bible book not contained in that versification.</div><div><br></div><div>I keep changing code to work around the above situation but realistically if the user is in the NT and then chooses a Module that doesn't support the NT it would be better if attempting to get the name (even to log an error) did not throw an exception.</div>
<div><br></div><div>Here is a simple junit to demonstrate the issue:</div><div><br></div><div><div> Versification MT = Versifications.instance().getVersification("MT");</div><div> Verse v = new Verse(MT, BibleBook.MATT, 1, 1);</div>
<div> v.toString();</div></div><div><br></div><div>Throws:</div><div><div>java.lang.NullPointerException</div><div><span class="" style="white-space:pre">        </span>at org.crosswire.jsword.versification.BibleNames.getPreferredName(BibleNames.java:64)</div>
<div><span class="" style="white-space:pre">        </span>at org.crosswire.jsword.versification.Versification.getPreferredName(Versification.java:290)</div><div><span class="" style="white-space:pre">        </span>at org.crosswire.jsword.passage.Verse.doGetName(Verse.java:622)</div>
<div><span class="" style="white-space:pre">        </span>at org.crosswire.jsword.passage.Verse.getName(Verse.java:271)</div><div><span class="" style="white-space:pre">        </span>at org.crosswire.jsword.passage.Verse.getName(Verse.java:256)</div>
<div><span class="" style="white-space:pre">        </span>at org.crosswire.jsword.passage.Verse.toString(Verse.java:249)</div><div><br></div></div><div><div>What do you think?</div></div><div><br></div><div>Thanks</div><div>Martin</div>
<div><br></div></div>