Furkan KILIC created TEXT-174:
---------------------------------

             Summary: ScriptStringLookup does not accept ":" 
                 Key: TEXT-174
                 URL: https://issues.apache.org/jira/browse/TEXT-174
             Project: Commons Text
          Issue Type: Bug
    Affects Versions: 1.8
            Reporter: Furkan KILIC


The usage of ":" can be pretty usefull for inside a ScriptStringLookup

 

For example ternary operations : 
{code:java}
${script:javascript:'${myKey:-}' == '' ? 'Not Present' : 'Present' }
{code}
Today it's not possible to do that because the lookup only expect one ":" 
{code:java}
final String[] keys = key.split(SPLIT_STR);
final int keyLen = keys.length;
if (keyLen != 2) {
    throw IllegalArgumentExceptions.format("Bad script key format [%s]; 
expected format is DocumentPath:Key.",
            key);
}
{code}
But we can limit the number of split to two:
{code:java}
final String[] keys = key.split(SPLIT_STR, 2);
{code}
 

I will create the PR for that later on

 

Thanks a lot

 

Best regards



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to