[jsword-devel] Version number issue in JSword

Martin Denham mjdenham at gmail.com
Thu Oct 28 13:10:27 MST 2010


The version number code in JSword's ConfigEntryType.java is no longer valid
because some modules no longer have simple N.N version numbers e.g. ESV and
NETFree are now 1.0.1, and 2TGreek is 2.5-090514. Therefore the parseFloat
test fails for these modules.  My suggestion for a fix, given the above
examples is either

   1. always return true from isAllowed
   2. return true if version is not empty/null
   3. add a regexp thet allows 0-9, ., -

     * An informational string indicating the current version of the book.
    public static final ConfigEntryType VERSION = new
ConfigEntryType("Version", "1.0") { //$NON-NLS-1$ //$NON-NLS-2$

        public boolean isAllowed(String aValue) {
            try {
                return true;
            } catch (NumberFormatException e) {
                return false;

Kind regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20101028/2b4c5530/attachment.html>

More information about the jsword-devel mailing list