You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2023/05/16 06:13:51 UTC

[GitHub] [maven] gnodet commented on a diff in pull request #1108: [MNG-7780] DefaultArtifact.equals throws NullPointerException if o.version is null

gnodet commented on code in PR #1108:
URL: https://github.com/apache/maven/pull/1108#discussion_r1194661277


##########
maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java:
##########
@@ -314,7 +314,9 @@ public boolean equals(Object o) {
             return false;
         } else if (!a.getArtifactId().equals(artifactId)) {
             return false;
-        } else if (!a.getVersion().equals(version)) {
+        } else if (a.getVersion() != null && !a.getVersion().equals(version)) {

Review Comment:
   How is that different from `!a.getGroupId().equals(groupId)` or `!a.getArtifactId().equals(artifactId)` ?



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org