Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7194

PluginParameterExpressionEvaluator incorrectly interpolates unknown subexpression

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rfscholte Robert Scholte
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: