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


##########
impl/maven-core/src/main/java/org/apache/maven/project/MavenProject.java:
##########
@@ -916,6 +916,10 @@ public Map<String, Artifact> getArtifactMap() {
         }
         return artifactMap;
     }
+    /** @since 4.1.0 */
+    public Map<String, Artifact> getArtifactMapByDependencyConflictId() {
+        return ArtifactUtils.artifactMapByDependencyConflictId(getArtifacts());

Review Comment:
   ⚠️ **Incomplete Javadoc.** The `/** @since 4.1.0 */` shorthand is missing 
the method description, `@return` tag, and context explaining why this method 
is needed alongside `getArtifactMap()`. Callers won't know they need this to 
handle classified artifacts.
   
   ```suggestion
       /**
        * Returns a map of artifacts keyed by {@link 
org.apache.maven.artifact.ArtifactUtils#artifactMapByDependencyConflictId(java.util.Collection)
 dependency conflict id}
        * (groupId:artifactId:type[:classifier]). Unlike {@link 
#getArtifactMap()}, this map disambiguates
        * artifacts that share the same groupId and artifactId but differ by 
classifier (e.g. a jar and its
        * {@code tests}-classified companion), which would otherwise collide 
under the same key.
        *
        * @return a mutable map keyed by dependency conflict id; if two 
artifacts share the same key the last one wins
        * @since 4.1.0
        */
       public Map<String, Artifact> getArtifactMapByDependencyConflictId() {
           return 
ArtifactUtils.artifactMapByDependencyConflictId(getArtifacts());
       }
   ```



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