Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+INF lexical representation for xsd:float and xsd:double is not parsed #4881

Open
RickMoynihan opened this issue Jan 25, 2024 · 1 comment
Open
Labels
🐞 bug issue is a bug specification issues related to compliance to standards and external specs

Comments

@RickMoynihan
Copy link

RickMoynihan commented Jan 25, 2024

Current Behavior

The class org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil does not parse the XSD lexical representation +INF for either floats or doubles.

See the spec for lexical representations and the four literals here: https://www.w3.org/TR/xmlschema11-2/#sec-lex-double.

I should add that I don't currently require support for this, it was just something I noticed whilst digging through the specs and code. It also seems that other implementations such as javax.xml.bind.DatatypeConverter have the same issue.

Expected Behavior

org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil.parseDouble("+INF"); // => Double.POSITIVE_INFINITY

Steps To Reproduce

org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil.parseDouble("+INF"); // java.lang.NumberFormatException For input string: "INF"

Version

4.3.7

Are you interested in contributing a solution yourself?

None

Anything else?

No response

@hmottestad
Copy link
Contributor

Thanks for discovering this bug!

@hmottestad hmottestad added the specification issues related to compliance to standards and external specs label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug issue is a bug specification issues related to compliance to standards and external specs
Projects
None yet
Development

No branches or pull requests

2 participants