[jsword-devel] Adding a transient property to SwordBookMetaData

Martin Denham mjdenham at gmail.com
Sat Nov 14 09:06:08 MST 2015


Hi DM,

I have made some minimal changes to support And Bible requirements and
submitted a pull request.

Cheers
Martin

On 13 November 2015 at 22:28, Martin Denham <mjdenham at gmail.com> wrote:

> Let me take a stab tomorrow.  It looks like somebody commented out the
> unit test I wanted to update, not sure why:
>    //SwordBookMetaDataTest.class, // bad test
>
> Martin
>
>
> On 13 November 2015 at 20:28, DM Smith <dmsmith at crosswire.org> wrote:
>
>> I’ve not had a chance yet. And here again it is Friday.
>>
>> — DM
>>
>> On Nov 13, 2015, at 11:41 AM, Martin Denham <mjdenham at gmail.com> wrote:
>>
>> Hi DM,
>>
>> I was thinking about having a look at this again, but did you find time
>> to investigate yet?
>>
>> Martin
>>
>> On 7 November 2015 at 00:43, DM Smith <dmsmith at crosswire.org> wrote:
>>
>>> I'll have to check this weekend.
>>>
>>> Cent from my fone so theer mite be tipos. ;)
>>>
>>> On Nov 6, 2015, at 5:57 PM, Martin Denham <mjdenham at gmail.com> wrote:
>>>
>>> Do the JSword junits currently run?
>>>
>>> I was trying to do a simple fix by adding another putProperty method to
>>> swordBookMetaData and also adding a new SwordMetaDataLocator.TRANSIENT :
>>>     public void putProperty(String key, String value,
>>> SwordMetaDataLocator metaDataLocator)
>>> which would allow me to set a property without persisting it.
>>>
>>> But I don't think that SwordBookMetaDataTest is currently working - at
>>> least it is one of the few tests that fails on my pc.
>>> The first problem I had was that SwordBookMetaData.KEY_DATA_PATH was not
>>> set causing an NPE in SwordBookMetaData.setLibrary, so I fixed that by
>>> adding this to the junit setUp()
>>>         table.add(SwordBookMetaData.KEY_DATA_PATH,
>>> "./modules/texts/ztext/kjv/");
>>>
>>> Then I got
>>> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>>> at org.crosswire.common.util.NetUtil.lengthenURI(NetUtil.java:391)
>>> at
>>> org.crosswire.jsword.book.sword.SwordBookMetaData.setLibrary(SwordBookMetaData.java:366)
>>> because the test URI is an empty string and 0-1 is out of bounds in
>>> NetUtil:
>>> char lastChar = path.charAt(path.length() - 1);
>>>
>>> So is the SwordBookMetaDataTest broken or am I doing something silly?
>>>
>>> Thanks
>>> Martin
>>>
>>>
>>> On 2 November 2015 at 21:44, Martin Denham <mjdenham at gmail.com> wrote:
>>>
>>>> And Bible adds a temporary property to SwordBookMetaData to identify
>>>> which repository a downloadable book came from.  This sort of property is
>>>> transient and does not need to be stored.  However, to prevent this
>>>> throwing an exception after upgrade to the recent JSword I needed to
>>>> specify this as a ui property which is persisted in the jsword-mods.d
>>>> folder.
>>>>
>>>> Currently BookMetadata.putproperty takes a boolean property which
>>>> determines where the property is persisted.
>>>> void putProperty(String key, String value, boolean forFrontend);
>>>> Would it be a good idea to make it possible to add transient properties
>>>> that are not persisted?  This might be done by using an enum instead of a
>>>> boolean for the third property.
>>>>
>>>> Martin
>>>>
>>>>
>>>>
>>> _______________________________________________
>>> jsword-devel mailing list
>>> jsword-devel at crosswire.org
>>> http://www.crosswire.org/mailman/listinfo/jsword-devel
>>>
>>>
>>> _______________________________________________
>>> jsword-devel mailing list
>>> jsword-devel at crosswire.org
>>> http://www.crosswire.org/mailman/listinfo/jsword-devel
>>>
>>>
>> _______________________________________________
>> jsword-devel mailing list
>> jsword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/jsword-devel
>>
>>
>>
>> _______________________________________________
>> jsword-devel mailing list
>> jsword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/jsword-devel
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20151114/a535d1b1/attachment-0001.html>


More information about the jsword-devel mailing list