You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2019/12/13 12:27:15 UTC

[GitHub] [maven] Tibor17 commented on a change in pull request #301: (minor) Fix NullPointerException

Tibor17 commented on a change in pull request #301: (minor) Fix NullPointerException
URL: https://github.com/apache/maven/pull/301#discussion_r357622468
 
 

 ##########
 File path: maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringVisitorModelInterpolator.java
 ##########
 @@ -1424,7 +1420,7 @@ private void visit( Properties properties )
                     {
                         String value = (String) v;
                         String inter = interpolate( value );
-                        if ( value != inter )
+                        if ( value != inter && Objects.nonNull( inter ) )
 
 Review comment:
   `nonNull` is used in Lambda with Method Reference and not like this.
   That\s the reason why `Objects.nonNull` was introduced in Java 1.8.
   Simple is better. Therefore `!= null`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services