gnodet-bot commented on code in PR #13296:
URL: https://github.com/apache/maven/pull/13296#discussion_r4134585130
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/resolver/MavenSnapshotMetadata.java:
##########
@@ -59,7 +59,10 @@ public static Object getKey(Artifact artifact) {
}
protected String getKey(String classifier, String extension) {
- return classifier + ':' + extension;
+ // A <snapshotVersion> without a <classifier> element reads as null,
while an artifact
+ // without a classifier has "". Both mean "no classifier" and must
share a key, or a
+ // merge keeps the previous build's entry next to the new one.
+ return (classifier == null ? "" : classifier) + ':' + extension;
}
Review Comment:
The null guard here is correct. However, `LocalSnapshotMetadata` in the same
package has its own **private** `getKey(String, String)` at line 124 that still
does `classifier + ':' + extension` — same bug, not fixed by this PR. Since
that method is private (not inherited from here), it needs the same treatment.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]