You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Mike Beckerle (Jira)" <ji...@apache.org> on 2023/02/17 18:59:00 UTC

[jira] [Commented] (DAFFODIL-2795) contentLength/valueLength of a literal throws a ClassCastException

    [ https://issues.apache.org/jira/browse/DAFFODIL-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17690536#comment-17690536 ] 

Mike Beckerle commented on DAFFODIL-2795:
-----------------------------------------

Presumably every function that has NodeInfo.Exists as a required "type" of an argument will also error this way. 

 

Pretty sure the fix for this has to do with Expression lazy val conversions.

That needs logic that looks at the targetType and the current class type. 

if the target type is Exists

  then if the type isn't PathExpression, then SDE about the expression must be a path expression. 

           else Nil (the list of conversions is Nil)

 else ... existing logic.

 

 

> contentLength/valueLength of a literal throws a ClassCastException
> ------------------------------------------------------------------
>
>                 Key: DAFFODIL-2795
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2795
>             Project: Daffodil
>          Issue Type: Bug
>            Reporter: Mike McGann
>            Priority: Minor
>
> The first argument to contentLength and valueLength should be a node, but if passed a literal string, the following exception is thrown:
> java.lang.ClassCastException: class org.apache.daffodil.core.dpath.LiteralExpression cannot be cast to class org.apache.daffodil.core.dpath.PathExpression (org.apache.daffodil.core.dpath.LiteralExpression and org.apache.daffodil.core.dpath.PathExpression are in unnamed module of loader 'app')



--
This message was sent by Atlassian Jira
(v8.20.10#820010)