stevedlawrence commented on code in PR #1137:
URL: https://github.com/apache/daffodil/pull/1137#discussion_r1446489170
##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/dpath/DState.scala:
##########
@@ -215,45 +218,26 @@ case class DState(
def booleanValue: Boolean = currentValue.getBoolean
def longValue: Long = asLong(currentValue.getAnyRef)
+
def intValue: Int = longValue.toInt
+
def doubleValue: Double = asDouble(currentValue.getAnyRef)
def integerValue: JBigInt = asBigInt(currentValue.getAnyRef)
+
def decimalValue: JBigDecimal = asBigDecimal(currentValue.getAnyRef)
+
def stringValue: String = currentValue.getString
def isNilled: Boolean = currentElement.isNilled
- private def isAnArray(): Boolean = {
- if (!currentNode.isInstanceOf[DIArray]) {
- Assert.invariant(errorOrWarn.isDefined)
- if (currentNode.isInstanceOf[DIElement]) {
- errorOrWarn.get.SDW(
- WarnID.PathNotToArray,
- "The specified path to element %s is not to an array. Suggest using
fn:exists instead.",
- currentElement.name,
- )
- } else {
- errorOrWarn.get.SDW(
- WarnID.PathNotToArray,
- "The specified path is not to an array. Suggest using fn:exists
instead.",
- )
- }
- false
- } else {
- true
- }
- }
-
Review Comment:
I'm wondering if we can get away with just removing the warnID? The only
place these warn IDs show up is with users disabling the warning. And if
someone is disabling this specific warning then it probably means they have
paths that don't resolve to an array. But this change now forces them to fix
that since it's now an SDE, so also forcing them to remove references to that
warning seems reasonable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]