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

Claude Warren commented on JENA-839:
------------------------------------

A quick check shows:

Uses of NodeFunctions.checkAndGetStringLiteral
E_Regex.eval() - 1st arg
static NodeFunctions.checkTwoArgumentStringLiterals()
XSDFuncOp.strConcat() - all the args
XSDFuncOp.strlen() - arg
XSDFuncOp.strLowerCase() - arg
XSDFuncOp.strReplace(3 args) - string and replacement
XSDFuncOp.strReplace(4 args) - pattern and flags (string and replacement passed 
to 3arg version)
XSDFuncOp.strUpperCase() - arg
XSDFuncOp.substring() - string arg

Uses of NodeFunctions.checkTwoArgumentStringLiterals()
XSDFuncOp.strAfter() - string and patch
XSDFuncOp.strBefore() - string and match
XSDFuncOp.strContains() - string and match
XSDFuncOp.strEndWidth() - string and match
XSDFuncOp.strStartsWith() - string and match

I  think that it is safe to change the accepted arguments to xsd:string and 
subclasses.

Anybody disagree?


> E_Regex only works with XSDstring.
> ----------------------------------
>
>                 Key: JENA-839
>                 URL: https://issues.apache.org/jira/browse/JENA-839
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ
>    Affects Versions: Jena 2.12.1
>         Environment: Linux
>            Reporter: Claude Warren
>            Assignee: Claude Warren
>
> E_Regex eval verifies the argument is a string using: 
> {noformat}
> Node arg = NodeFunctions.checkAndGetStringLiteral("REGEX", args.get(0)) ;
> {noformat}
>  NodeFunctions.checkAndGetStringLiteral verifies that if the nodevalue is not 
> null and is an XSDstring by the following statement:
> {noformat}
>  if ( dt != null && !dt.equals(XSDDatatype.XSDstring) )
>             throw new ExprEvalException(label + ": Not a string literal: " + 
> nv) ;
> {noformat}
> this means that other string types (e.g. XSDnormalizedString) fail.
> I believe that the check should be to check that dt is an instanceof 
> XSDBaseStringType.
> I am looking for comment before making the change.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to