[jsword-devel] [JIRA] Created: (JS-137) StringIndexOutOfBoundsException in GBFFilter ~ line 115

Chris Burrell (JIRA) jira at crosswire.org
Wed Dec 1 15:25:23 MST 2010


StringIndexOutOfBoundsException in GBFFilter ~ line 115
-------------------------------------------------------

                 Key: JS-137
                 URL: http://www.crosswire.org/bugs/browse/JS-137
             Project: JSword
          Issue Type: Bug
          Components: o.c.jsword.book.filter.gbf
    Affects Versions: 1.6
            Reporter: Chris Burrell
            Assignee: DM Smith


I'm not able to replicate and have lost the stack trace, but here's the cause of it, and the fix should be easy. Not sure why I can't replicate though:

Exception: String index out of range: 8

so if 'remains' is of length 8, ltpos = 7 => StringIndexOutOfBoundsException

Code:
if (ltpos >= 0
                        && ltpos < remains.length()
                        && Character.isUpperCase(remains.charAt(ltpos + 1)))
                {
                    DataPolice.report("Possible bad GBF tag" + remains); //$NON-NLS-1$
                }

Is the easy fix just to ensure that ltpost < remains.length() - 1
Or is more complicated than that?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://www.crosswire.org/bugs/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jsword-devel mailing list