You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Brian Minchau (JIRA)" <xa...@xml.apache.org> on 2006/11/01 01:29:20 UTC
[jira] Closed: (XALANJ-1708) The number() function fails
[ 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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org