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. -- 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: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org