Details
-
Type: Sub-task
-
Status: Closed (View Workflow)
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.6
-
Fix Version/s: 1.7
-
Component/s: o.c.jsword.book.sword
-
Labels:None
Description
Jsword bug if sword module conf does not have lang entry eg: TDavid commentary
How to recreate the bug
- using nightly ver 05 Sep 2009
- run BibleDesktop
- on the Menu - Tools- Options (Bible Display section) choose List Commentaries with Bible
- Now on the main display/window, choose to open at least 2 book eg: KJV and TDavid (this is the bug)
My investigation is due to the TDavid module.conf does not have lang entry. If I modify the module.conf and add lang entry, then there is no bug.
The fix is rather simple
- on o.c.j.book.BookData (around line 241-242) under method getOsisContent()
- there is a line something like
Language lang = (Language) book.getProperty(BookMetaData.KEY_XML_LANG);
cell.setAttribute(OSISUtil.OSIS_ATTR_LANG, lang.getCode(), Namespace.XML_NAMESPACE); - the problem is "lang" could be null. So maybe check for null is needed before call lang.getCoded(),
or maybe assign the thing (by default) to english in the book property, if lang is undefined in the module.conf
----- stack trace ---------------
Sep 9, 2009 2:46:48 PM org.crosswire.common.util.Reporter informUser
INFO: Unexpected internal problem. You may need to restart.
org.crosswire.common.util.LucidException: Unexpected internal problem. You may need to restart.
at org.crosswire.common.util.Reporter$CustomAWTExceptionHandler.handle(Reporter.java:307)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.awt.EventDispatchThread.handleException(EventDispatchThread.java:388)
at java.awt.EventDispatchThread.processException(EventDispatchThread.java:294)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:286)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.NullPointerException
at org.crosswire.jsword.book.BookData.getOsisContent(BookData.java:242)
at org.crosswire.jsword.book.BookData.getOsisFragment(BookData.java:106)
at org.crosswire.jsword.book.BookData.getSAXEventProvider(BookData.java:119)
at org.crosswire.bibledesktop.display.basic.TextPaneBookDataDisplay.refresh(TextPaneBookDataDisplay.java:156)
at org.crosswire.bibledesktop.display.basic.TextPaneBookDataDisplay.setBookData(TextPaneBookDataDisplay.java:115)
at org.crosswire.bibledesktop.display.basic.TabbedBookDataDisplay.setBookData(TabbedBookDataDisplay.java:163)
at org.crosswire.bibledesktop.display.basic.SplitBookDataDisplay.setBookData(SplitBookDataDisplay.java:115)
at org.crosswire.bibledesktop.book.BibleViewPane$1.bookChosen(BibleViewPane.java:121)
at org.crosswire.bibledesktop.book.DisplaySelectPane.fireVersionChanged(DisplaySelectPane.java:745)
at org.crosswire.bibledesktop.book.DisplaySelectPane.booksChosen(DisplaySelectPane.java:649)
at org.crosswire.bibledesktop.book.ParallelBookPicker.fireBooksChosen(ParallelBookPicker.java:216)
at org.crosswire.bibledesktop.book.ParallelBookPicker$SelectedItemListener.itemStateChanged(ParallelBookPicker.java:267)
at javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1205)
at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1262)
at javax.swing.JComboBox.contentsChanged(JComboBox.java:1309)
at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:100)
at org.crosswire.bibledesktop.book.BooksListModel.fireContentsChanged(BooksListModel.java:207)
at org.crosswire.bibledesktop.book.BooksComboBoxModel.setSelectedItem(BooksComboBoxModel.java:104)
at javax.swing.JComboBox.setSelectedItem(JComboBox.java:557)
at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:603)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:816)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
at java.awt.Component.processMouseEvent(Component.java:6216)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:480)
at java.awt.Component.processEvent(Component.java:5981)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4583)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
... 5 more