You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Steve Rowe (JIRA)" <ji...@apache.org> on 2018/04/20 15:51:00 UTC

[jira] [Commented] (LUCENE-8261) InterpolatedProperties.interpolate should quote the replacement

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

Steve Rowe commented on LUCENE-8261:
------------------------------------

I believe that error happens because {{InterpolatedProperties}}'s interpolation is not recursive, but people have tried to use multiple indirection, e.g.

{noformat}
propA=value
propB=${propA}
/org/name=${propB}
{noformat}

So suppressing the error (via {{Pattern.quoteReplacement}}) would cause a different kind of trouble.

I haven't done anything about this because none of the attempts at multiple indirection has persisted.  Probably {{ivy-versions.properties}} validation should look for this and fail?

> InterpolatedProperties.interpolate should quote the replacement
> ---------------------------------------------------------------
>
>                 Key: LUCENE-8261
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8261
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Dawid Weiss
>            Assignee: Dawid Weiss
>            Priority: Trivial
>         Attachments: LUCENE-8261.patch
>
>
> InterpolatedProperties is used in lib check tasks in the build file. I occasionally see this:
> {code}
> /home/jenkins/workspace/Lucene-Solr-master-Linux/lucene/tools/custom-tasks.xml:108: java.lang.IllegalArgumentException: named capturing group is missing trailing '}'
>         at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1052)
>         at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:908)
>         at org.apache.lucene.dependencies.InterpolatedProperties.interpolate(InterpolatedProperties.java:64)
> {code}
> I don't think we ever need to use any group references in those replacements; they should be fixed strings (quoted verbatim)? So {{Pattern.quoteReplacement}} would be adequate here.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org