Sahil-Jaiswal-189 commented on code in PR #13945:
URL: https://github.com/apache/maven/pull/13945#discussion_r4527360466


##########
impl/maven-impl/src/main/java/org/apache/maven/impl/AetherDependencyWrapper.java:
##########
@@ -116,6 +119,30 @@ public DependencyScope scope() {
         return session.requireDependencyScope(dependency.getScope());
     }
 
+    /**
+     * {@return the transitive dependency exclusions}
+     */
+    @Nonnull
+    public Collection<Exclusion> exclusions() {
+        return new MappedCollection<>(dependency.getExclusions(), 
this::toExclusion);
+    }
+
+    private Exclusion toExclusion(org.eclipse.aether.graph.Exclusion 
exclusion) {
+        return new Exclusion() {
+            @Nullable
+            @Override
+            public String groupId() {
+                return exclusion.getGroupId();
+            }
+
+            @Nullable
+            @Override
+            public String artifactId() {
+                return exclusion.getArtifactId();
+            }
+        };
+    }

Review Comment:
   Both Exclusion.groupId() and artifactId() are already annotated @Nullable on 
master, and their Javadoc explicitly permits null for wildcards.
   
   This PR moves the existing toExclusion() implementation unchanged from 
DefaultDependencyCoordinates to AetherDependencyWrapper, retaining its 
annotations. No nullability-contract mismatch is introduced, so neither API 
changes nor normalization to "*" are needed to address this finding.



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