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


##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/EnhancedLocalRepositoryManager.java:
##########
@@ -175,6 +178,19 @@ private void checkFind(File file, LocalArtifactResult 
result) {
         }
     }
 
+    /**
+     * Returns the key Maven Resolver 2.x writes by default ({@code 
<id>-<sha1(url)>}), so that an artifact downloaded
+     * by Maven 3.10 or 4 from the same repository is accepted. Entries are 
still written with
+     * {@link #getRepositoryKey(RemoteRepository, String)}.
+     */

Review Comment:
   The Javadoc description `{@code <id>-<sha1(url)>}` is accurate only for 
non-repository-manager repositories. For repository managers, the seed is `url 
+ context`, making the actual key `<pathSegment(id)>-<sha1(url+context)>`. 
Anyone debugging a cross-version cache miss on a repository manager will be 
misled by the current description.
   
   ```suggestion
       /**
        * Returns the key Maven Resolver 2.x writes by default, so that an 
artifact downloaded
        * by Maven 3.10 or 4 from the same repository is accepted. For a plain 
repository this is
        * {@code <pathSegment(id)>-<sha1(url)>}; for a repository manager the 
context is appended to
        * the URL before hashing: {@code 
<pathSegment(id)>-<sha1(url+context)>}. Entries are still written with
        * {@link #getRepositoryKey(RemoteRepository, String)}.
        */
   ```



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