Skip to content

[MNG-7194] PluginParameterExpressionEvaluator incorrectly interpolates unknown subexpression #8255

@jira-importer

Description

@jira-importer

Robert Scholte opened MNG-7194 and commented

The PluginParameterExpressionEvaluator evaluate(String,Class)-method ends like this:

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 ) );
        }
    }
}

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.


Issue Links:

  • MENFORCER-363 Unexpected result from requireProperty with regex when the property is not fully resolved
    ("causes")

Remote Links:

0 votes, 6 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:minorMinor loss of function, or other problem where easy workaround is present

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions