[ http://issues.apache.org/jira/browse/XALANJ-1708?page=all ]
Brian Minchau closed XALANJ-1708. --------------------------------- > The number() function fails > --------------------------- > > Key: XALANJ-1708 > URL: http://issues.apache.org/jira/browse/XALANJ-1708 > Project: XalanJ2 > Issue Type: Bug > Components: XPath > Affects Versions: 2.5 > Environment: Operating System: All > Platform: Other > Reporter: David Perez > Fix For: 2.7 > > Attachments: Bug24246XStringForFSB.txt > > > For example if we try number(' ') (all spaces), the following happens: > public double toDouble() > { > if(m_length == 0) > return Double.NaN; > int i; > char c; > String valueString = fsb().getString(m_start,m_length); > > for (i=0;i<m_length;i++) > if (!XMLCharacterRecognizer.isWhiteSpace(valueString.charAt(i))) > break; > if (valueString.charAt(i) == '-') > <---------Fails here with a StringIndexOutOfBoundsException > i++; > ..... > } > An easy solution is to catch the StringIndexOutOfBoundsException and return in > that case Double.NaN. > Note: this error has been detected in version 2.5.1, but appears to be also > in 2.5.2 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
