essobedo commented on code in PR #8749:
URL: https://github.com/apache/camel/pull/8749#discussion_r1028372379
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java:
##########
@@ -342,15 +342,15 @@ private int run() throws Exception {
writeSetting(main, profileProperties, "camel.jbang.console", console ?
"true" : "false");
writeSetting(main, profileProperties,
"camel.main.routesCompileDirectory", WORK_DIR);
// merge existing dependencies with --deps
- String dep = profileProperties != null ?
profileProperties.getProperty("camel.jbang.dependencies") : null;
- if (dep == null) {
- dep = dependencies;
- } else if (dependencies != null && !dependencies.equals(dep)) {
- dep += "," + dependencies;
- }
- if (dep != null) {
- main.addInitialProperty("camel.jbang.dependencies", dep);
- writeSettings("camel.jbang.dependencies", dep);
+ String deps = RuntimeUtil.getDependencies(profileProperties);
+ if (deps.isBlank()) {
+ deps = dependencies;
+ } else if (dependencies != null && !dependencies.equals(deps)) {
+ deps += "," + dependencies;
+ }
+ if (!deps.isBlank()) {
Review Comment:
Warning `deps` could be `null` in case `deps.isBlank()` returns initially
`true` and `dependencies` is `null`. In this case, we would end up with an NPE
--
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]