gnodet-bot commented on code in PR #27959:
URL: https://github.com/apache/camel/pull/27959#discussion_r4300366307


##########
dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/DependencyCheckTools.java:
##########
@@ -336,8 +354,9 @@ private boolean hasExplicitVersion(String pomContent, 
String artifactId) {
     }
 
     private boolean hasCamelBom(MigrationData.PomAnalysis pom) {
-        return pom.dependencies().stream()
-                .anyMatch(d -> d.endsWith("-bom") || 
d.equals("camel-dependencies"));
+        return Stream.concat(pom.dependencies().stream(), 
pom.managedDependencies().stream())
+                .anyMatch(d -> d.startsWith("camel-") && d.endsWith("-bom") || 
d.equals("camel-dependencies")
+                        || d.equals("quarkus-camel-bom"));

Review Comment:
   Nit: Java operator precedence makes `&&` bind tighter than `||` here, so the 
logic is already correct, but the absence of parentheses means a future reader 
(or a linter) might misread the `||` chain as applying to the entire first 
condition. Explicit grouping removes the ambiguity:
   
   ```suggestion
                   .anyMatch(d -> (d.startsWith("camel-") && 
d.endsWith("-bom")) || d.equals("camel-dependencies")
                           || d.equals("quarkus-camel-bom"));
   ```



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