gnodet-bot commented on code in PR #29778:
URL: https://github.com/apache/camel/pull/29778#discussion_r4556870976
##########
tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenDownloader.java:
##########
@@ -79,6 +80,23 @@ default List<MavenArtifact> resolveArtifacts(
return resolveArtifacts(rootGav, dependencyGAVs, extraRepositories,
transitively, useApacheSnapshots);
}
+ /**
+ * Resolves the artifacts as {@link #resolveArtifacts(String, List, Set,
boolean, boolean, Predicate)} does, with
+ * the versions of the managed artifacts: a transitive dependency on one
of them gets its version, as with the
+ * dependencyManagement of a Maven project. For example, the libraries
already loaded, so a library is not resolved
+ * again in another version.
+ *
+ * @param managed the artifacts whose version is used for the transitive
dependencies on them, or null
+ */
Review Comment:
💡 The new `default` method is missing a `@since` tag in its Javadoc. Other
methods in this interface carry `@since 4.x.x` — this one should too.
```suggestion
* @param managed the artifacts whose version is used for the transitive
dependencies on them, or null
* @since 4.24
*/
```
##########
dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/MavenDependencyDownloader.java:
##########
@@ -639,6 +646,10 @@ public void artifactDownloaded(
mavenDownloader = mavenDownloaderImpl;
}
+ private static String managementKey(MavenGav gav) {
+ return gav.getGroupId() + ":" + gav.getArtifactId() + ":" +
gav.getClassifier() + ":" + gav.getPackaging();
Review Comment:
💡 `getClassifier()` and `getPackaging()` can be `null`, which Java's string
concatenation silently renders as the literal `"null"` — producing keys like
`"groupId:artifactId:null:null"`. This is cosmetic (the key is still consistent
and unique in practice) but could confuse debugging. Consider using
`Objects.toString(gav.getClassifier(), "")` and
`Objects.toString(gav.getPackaging(), "")` for a cleaner representation.
--
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]