Details

    • Type: Bug Bug
    • Status: Resolved (View Workflow)
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.1
    • Component/s: None
    • Labels:
      None
    • Environment:

      Tested in BibleDesktop/JSword nightly 2010-10-20
      Ubuntu Linux 10.4
      Java 1.6.0_22

      Description

      Tested in BibleDesktop/JSword nightly 2010-10-20.

      Toggle Show Differences (Menu - View) aka comparing bible, does not work. It show empty screen. The log/console show

      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
      at java.lang.String.charAt(String.java:686)
      at org.crosswire.jsword.book.OSISUtil.getCanonicalText(OSISUtil.java:666)
      at org.crosswire.jsword.book.BookData.getOsisContent(BookData.java:227)
      at org.crosswire.jsword.book.BookData.getOsisFragment(BookData.java:99)
      at org.crosswire.jsword.book.BookData.getSAXEventProvider(BookData.java:112)
      at org.crosswire.bibledesktop.display.basic.TextPaneBookDataDisplay.refresh(TextPaneBookDataDisplay.java:156)
      ...

      Full error log

      org.crosswire.common.swing.ActionFactory(WARNING): Could not execute method org.crosswire.bibledesktop.desktop.DesktopActions.doCompareToggle()
      java.lang.reflect.InvocationTargetException
      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 org.crosswire.common.swing.ActionFactory.actionPerformed(ActionFactory.java:196)
      at org.crosswire.common.swing.CWAction.actionPerformed(CWAction.java:86)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:291)
      at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
      at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1223)
      at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1264)
      at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
      at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
      at java.awt.Component.processMouseEvent(Component.java:6267)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
      at java.awt.Component.processEvent(Component.java:6032)
      at java.awt.Container.processEvent(Container.java:2041)
      at java.awt.Component.dispatchEventImpl(Component.java:4630)
      at java.awt.Container.dispatchEventImpl(Container.java:2099)
      at java.awt.Component.dispatchEvent(Component.java:4460)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
      at java.awt.Container.dispatchEventImpl(Container.java:2085)
      at java.awt.Window.dispatchEventImpl(Window.java:2478)
      at java.awt.Component.dispatchEvent(Component.java:4460)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      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.StringIndexOutOfBoundsException: String index out of range: 0
      at java.lang.String.charAt(String.java:686)
      at org.crosswire.jsword.book.OSISUtil.getCanonicalText(OSISUtil.java:666)
      at org.crosswire.jsword.book.BookData.getOsisContent(BookData.java:227)
      at org.crosswire.jsword.book.BookData.getOsisFragment(BookData.java:99)
      at org.crosswire.jsword.book.BookData.getSAXEventProvider(BookData.java:112)
      at org.crosswire.bibledesktop.display.basic.TextPaneBookDataDisplay.refresh(TextPaneBookDataDisplay.java:156)
      at org.crosswire.bibledesktop.display.basic.TextPaneBookDataDisplay.setCompareBooks(TextPaneBookDataDisplay.java:126)
      at org.crosswire.bibledesktop.display.basic.TextPaneBookDataDisplay.propertyChange(TextPaneBookDataDisplay.java:265)
      at org.crosswire.bibledesktop.display.basic.TabbedBookDataDisplay.propertyChange(TabbedBookDataDisplay.java:273)
      at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
      at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:347)
      at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:75)
      at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
      at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:318)
      at org.crosswire.bibledesktop.desktop.Desktop.setCompareShowing(Desktop.java:889)
      at org.crosswire.bibledesktop.desktop.DesktopActions.doCompareToggle(DesktopActions.java:321)
      ... 35 more

        Activity

        Hide
        DM Smith added a comment -

        Tonny, Thanks for the report. I think I've fixed it. Could you verify please?

        The problem I found was that the old jsword-common-1.6.jar was still present in nightly and it was confusing the class loader. I changed a couple of the build scripts and did a clean build on the server and it seems to be fixed.

        Show
        DM Smith added a comment - Tonny, Thanks for the report. I think I've fixed it. Could you verify please? The problem I found was that the old jsword-common-1.6.jar was still present in nightly and it was confusing the class loader. I changed a couple of the build scripts and did a clean build on the server and it seems to be fixed.
        Hide
        Tonny Kohar added a comment -

        Hi DM

        It is still the same error, this time I am using the pre-build nightly binary (22 Nov 2010)

        Thanks

        Show
        Tonny Kohar added a comment - Hi DM It is still the same error, this time I am using the pre-build nightly binary (22 Nov 2010) Thanks
        Hide
        DM Smith added a comment -

        Tonny,
        I'm not able to reproduce. I tried the nightly WebStart and the Linux download (jsword-1.6-20101122) on my Mac and did a comparison of Genesis 1 between KJV and ESV. No exceptions.
        Can you tell me what you were comparing (both the versions of the Bible and the passage) and which OS version (e.g. Fedora 14) and which version of Java.
        Thanks,
        DM

        Show
        DM Smith added a comment - Tonny, I'm not able to reproduce. I tried the nightly WebStart and the Linux download (jsword-1.6-20101122) on my Mac and did a comparison of Genesis 1 between KJV and ESV. No exceptions. Can you tell me what you were comparing (both the versions of the Bible and the passage) and which OS version (e.g. Fedora 14) and which version of Java. Thanks, DM
        Hide
        Tonny Kohar added a comment -

        Hi,

        I tested again using KJV and ESV on Matt 1, yes it works.

        However, some bible have error eg: ASV, MKJV, RNKJV
        Bible which work: KJV, ESV, ISV, NETFree, WEB

        It is tested on
        Ubuntu 10.4 (with latest update)
        Java 1.6.0_22

        Cheers
        Tonny Kohar

        Show
        Tonny Kohar added a comment - Hi, I tested again using KJV and ESV on Matt 1, yes it works. However, some bible have error eg: ASV, MKJV, RNKJV Bible which work: KJV, ESV, ISV, NETFree, WEB It is tested on Ubuntu 10.4 (with latest update) Java 1.6.0_22 Cheers Tonny Kohar
        Hide
        DM Smith added a comment -

        I fixed this with the following:

        Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java
        ===================================================================
        — trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java 2010-11-23 01:45:42 UTC (rev 2018)
        +++ trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java 2010-11-24 23:13:51 UTC (rev 2019)
        @@ -663,10 +663,13 @@
        // containing entities.
        int lastIndex = buffer.length() - 1;
        String text = ((Text) data).getText();

        • if (lastIndex >= 0 && !Character.isWhitespace(buffer.charAt(lastIndex)) && !Character.isWhitespace(text.charAt(0))) {
        • buffer.append(' ');
          + // Ignore empty text nodes.
          + if (text.length() != 0)
          Unknown macro: {+ if (lastIndex >= 0 && !Character.isWhitespace(buffer.charAt(lastIndex)) && !Character.isWhitespace(text.charAt(0))) { + buffer.append(' '); + }+ buffer.append(text); }
        • buffer.append(text);
          }
          }
        Show
        DM Smith added a comment - I fixed this with the following: Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java =================================================================== — trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java 2010-11-23 01:45:42 UTC (rev 2018) +++ trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java 2010-11-24 23:13:51 UTC (rev 2019) @@ -663,10 +663,13 @@ // containing entities. int lastIndex = buffer.length() - 1; String text = ((Text) data).getText(); if (lastIndex >= 0 && !Character.isWhitespace(buffer.charAt(lastIndex)) && !Character.isWhitespace(text.charAt(0))) { buffer.append(' '); + // Ignore empty text nodes. + if (text.length() != 0) Unknown macro: {+ if (lastIndex >= 0 && !Character.isWhitespace(buffer.charAt(lastIndex)) && !Character.isWhitespace(text.charAt(0))) { + buffer.append(' '); + }+ buffer.append(text); } buffer.append(text); } }
        Hide
        DM Smith added a comment -

        Haven't heard that the fix did not work. Assuming that it did.

        Please reopen if it is still a problem.

        Show
        DM Smith added a comment - Haven't heard that the fix did not work. Assuming that it did. Please reopen if it is still a problem.

          People

          • Assignee:
            DM Smith
            Reporter:
            Tonny Kohar
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: