gnodet-bot commented on code in PR #13672:
URL: https://github.com/apache/maven/pull/13672#discussion_r4345265854


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/ArtifactUtils.java:
##########
@@ -111,6 +111,26 @@ public static Map<String, Artifact> 
artifactMapByVersionlessId(Collection<Artifa
         return artifactMap;
     }
 
+    /**
+     * Builds a map of artifacts keyed by {@link 
Artifact#getDependencyConflictId()}
+     * (groupId:artifactId:type[:classifier]). Unlike {@link 
#artifactMapByVersionlessId(Collection)}, this
+     * disambiguates artifacts that share the same groupId and artifactId but 
differ by classifier, such as a
+     * jar and its "tests" or "sources" classified companion, which would 
otherwise collide under the same key.
+     *
+     * @since 4.1.0
+     */

Review Comment:
   ⚠️ **Incomplete Javadoc.** The method has neither `@param` nor `@return` 
tags. Given this is public API (and even if it's compat-only, it'll be picked 
up by tooling), these should be present:
   
   ```suggestion
        * @param artifacts the artifacts to build the map from, may be {@code 
null}
        * @return a mutable {@link java.util.LinkedHashMap} keyed by dependency 
conflict id;
        *         if two artifacts share the same conflict id the last one wins
        * @since 4.1.0
        */
   ```
   
   The silent-overwrite behaviour for duplicate keys (same 
groupId:artifactId:type:classifier) should also be documented — callers can't 
know whether to pre-deduplicate.



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

Reply via email to