elharo commented on a change in pull request #303: [MNG-6831] replace anonymous
classes by lambdas
URL: https://github.com/apache/maven/pull/303#discussion_r364193755
##########
File path:
maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuilder.java
##########
@@ -241,20 +240,17 @@ private Settings interpolate( Settings settings,
SettingsBuildingRequest request
+ e.getMessage(), -1, -1, e );
}
- interpolator.addPostProcessor( new InterpolationPostProcessor()
+ interpolator.addPostProcessor( ( expression, value ) ->
{
- @Override
- public Object execute( String expression, Object value )
+ if ( value != null )
{
- if ( value != null )
- {
- // we're going to parse this back in as XML so we need to
escape XML markup
- value = value.toString().replace( "&", "&" ).replace(
"<", "<" ).replace( ">", ">" );
- return value;
- }
- return null;
+ // we're going to parse this back in as XML so we need to
escape XML markup
+ value = value.toString().replace( "&", "&" ).replace( "<",
"<" ).replace( ">", ">" );
Review comment:
Nothing specific and not this PR's problem to fix. It just happened to call
my attention to it. I've just learned from experience that these sorts of
replacements always go wrong. Just a note to myself to dig into this, really.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services