-
-
Notifications
You must be signed in to change notification settings - Fork 188
Fix XQuery 3.1 casting and numeric comparison compliance #6165
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
Changes from all commits
4434be9
97f7bde
22b515d
1f69c48
f92f3e6
bd7ccdc
a28275b
8b7a95a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -195,21 +195,21 @@ public AtomicValue convertTo(final int requiredType) throws XPathException { | |
|
|
||
| public DecimalValue toDecimalValue() throws XPathException { | ||
| if (isNaN() || isInfinite()) { | ||
| throw conversionError(Type.DECIMAL); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why was the method call |
||
| throw conversionError(ErrorCodes.FOCA0002, Type.DECIMAL); | ||
| } | ||
| return new DecimalValue(getExpression(), BigDecimal.valueOf(value)); | ||
| } | ||
|
|
||
| public IntegerValue toIntegerValue() throws XPathException { | ||
| if (isNaN() || isInfinite()) { | ||
| throw conversionError(Type.INTEGER); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why no longer using the existing
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as in |
||
| throw conversionError(ErrorCodes.FOCA0002, Type.INTEGER); | ||
| } | ||
| return new IntegerValue(getExpression(), (long) value); | ||
| } | ||
|
|
||
| public IntegerValue toIntegerSubType(final int subType) throws XPathException { | ||
| if (isNaN() || isInfinite()) { | ||
| throw conversionError(subType); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why no longer using the existing
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as in |
||
| throw conversionError(ErrorCodes.FOCA0002, subType); | ||
| } | ||
| if (subType != Type.INTEGER && value > Integer.MAX_VALUE) { | ||
| throw new XPathException(getExpression(), ErrorCodes.FOCA0003, "Value is out of range for type " | ||
|
|
@@ -219,7 +219,11 @@ public IntegerValue toIntegerSubType(final int subType) throws XPathException { | |
| } | ||
|
|
||
| private XPathException conversionError(final int type) { | ||
| return new XPathException(getExpression(), ErrorCodes.FORG0001, "Cannot convert " | ||
| return conversionError(ErrorCodes.FORG0001, type); | ||
| } | ||
|
|
||
| private XPathException conversionError(final ErrorCodes.ErrorCode errorCode, final int type) { | ||
| return new XPathException(getExpression(), errorCode, "Cannot convert " | ||
| + Type.getTypeName(getType()) + "('" + getStringValue() + "') to " | ||
| + Type.getTypeName(type)); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no longer using the existing
conversionError()method?