[
https://issues.apache.org/jira/browse/MNG-7194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17853640#comment-17853640
]
ASF GitHub Bot commented on MNG-7194:
-------------------------------------
pzygielo commented on PR #1574:
URL: https://github.com/apache/maven/pull/1574#issuecomment-2158199989
- The
[failure](https://github.com/apache/maven/actions/runs/9448106653/job/26021560449?pr=1574#step:5:2679)
- as in #1571 - is _expected_ with current implementation.
However the current implementation is not expected by me.
> PluginParameterExpressionEvaluator incorrectly interpolates unknown
> subexpression
> ---------------------------------------------------------------------------------
>
> Key: MNG-7194
> URL: https://issues.apache.org/jira/browse/MNG-7194
> Project: Maven
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Reporter: Robert Scholte
> Priority: Minor
>
> The PluginParameterExpressionEvaluator evaluate(String,Class)-method ends
> like this:
> {code:java}
> if ( value instanceof String )
> {
> // TODO: without #, this could just be an evaluate call...
> String val = (String) value;
> int exprStartDelimiter = val.indexOf( "${" );
> if ( exprStartDelimiter >= 0 )
> {
> if ( exprStartDelimiter > 0 )
> {
> value = val.substring( 0, exprStartDelimiter ) +
> evaluate( val.substring( exprStartDelimiter ) );
> }
> else
> {
> value = evaluate( val.substring( exprStartDelimiter ) );
> }
> }
> }
> {code}
> Assume that pre${unknown} needs to be evaluated and {{unknown}} does not
> exist, the result well be "{{prenull}}"
> Just ${unknown} evaluates to null, but because there's no String concat it
> will be a real null.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)