gnodet-bot commented on code in PR #2192:
URL: https://github.com/apache/maven-resolver/pull/2192#discussion_r4223844975


##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java:
##########
@@ -275,6 +275,9 @@ private List<ArtifactResult> resolve(
                     List<RemoteRepository> filteredRemoteRepositories = new 
ArrayList<>(remoteRepositories);
                     if (filter != null) {
                         for (RemoteRepository repository : remoteRepositories) 
{
+                            if 
(!repository.getPolicy(artifact.isSnapshot()).isEnabled()) {
+                                continue;
+                            }

Review Comment:
   💡 **Minor:** The disabled repository is skipped from filter evaluation (✅) 
but stays in `filteredRemoteRepositories`, so it will still be handed to the 
version resolver and local artifact lookup before being skipped again at 
download time by the identical policy check at line ~392. The 
`filteredRemoteRepositories` name implies the list contains only live 
candidates — consider also removing it to match the semantics used in the 
metadata resolver (which fully skips via `getEnabledSourceRepositories()`):
   
   ```suggestion
                               if 
(!repository.getPolicy(artifact.isSnapshot()).isEnabled()) {
                                   
filteredRemoteRepositories.remove(repository);
                                   continue;
                               }
   ```



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