[ https://issues.apache.org/jira/browse/MRESOLVER-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543673#comment-17543673 ]
ASF GitHub Bot commented on MRESOLVER-262: ------------------------------------------ cstamas commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884301868 ########## maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectorDelegate.java: ########## @@ -290,6 +290,33 @@ public final CollectResult collectDependencies( RepositorySystemSession session, return result; } + /** + * Creates child {@link RequestTrace} instance from passed in {@link RequestTrace} and parameters by creating + * {@link CollectStepDataImpl} instance out of passed in data. Caller must ensure that passed in parameters are + * NOT affected by threading (or that there is no multi threading involved). In other words, the passed in values + * should be immutable. + * + * @param trace The current trace instance. + * @param context The context from {@link CollectRequest#getRequestContext()}, never {@code null}. + * @param path List representing the path of dependency nodes, never {@code null}. Caller must ensure, that this + * list does not change during the lifetime of the requested {@link RequestTrace} instance. If it may + * change, simplest is to pass here a copy of used list. + * @param node Currently collected node, that collector came by following the passed in path. + * @return A child request trance instance, never {@code null}. + */ + protected RequestTrace collectStepTrace( RequestTrace trace, String context, List<DependencyNode> path, Review Comment: Am least certain about this method: it does "too little" IMHO. For example, it could just take a copy the passed in "path" parameter list, but OTOH, am unsure how big penalty (heap, GC wise) would this introduce. Hence, am leaving this decision (to copy or not copy the list) to subclass, as subclass should know does it requires a copy or not, or in other words, is it multi threaded or not. DF for sure does not need to copy it (reason more why not to copy it here). BF once goes to "multi threaded POM download" it may, but as I see, each thread will have it's own context, and context carries the list, so again, I see no need for list copy. > Provide contextual data in trace data for collector invoked requests > -------------------------------------------------------------------- > > Key: MRESOLVER-262 > URL: https://issues.apache.org/jira/browse/MRESOLVER-262 > Project: Maven Resolver > Issue Type: Task > Components: Resolver > Reporter: Tamás Cservenák > Priority: Major > Fix For: 1.8.1 > > > During collection several RepositoryEvents are fired, but they does not carry > any context related data regarding artifact collection. > Simplest solution would be to extend RequestTrace to provide: > * request context > * the artifact path (from root to leaf) > * leaf artifact being collected -- This message was sent by Atlassian Jira (v8.20.7#820007)