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


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java:
##########
@@ -2096,6 +2103,46 @@ static void writeCamelMainRunLogConfig(Path target, 
String appName, String loggi
         }
     }
 
+    /**
+     * The reload pattern of dev mode with a source directory: every file 
under it, except the data folders
+     * (--data-dir), whose files the routes read and write: a change there is 
not a change of the sources, and reloading
+     * the routes for it restarts them, so they write again and reload again 
(CAMEL-25670).
+     */
+    /**
+     * --data-dir only changes what dev mode watches in a source directory: 
without one only the given files are
+     * watched, and their data folders are not, so the option has nothing to 
leave out. Said when it is given on the
+     * command line; camel.jbang.dataDir in an application.properties is not, 
as an example that declares its data
+     * folders also runs with its files (camel run --example).
+     */

Review Comment:
   💡 **Two consecutive `/** */` javadoc blocks**
   
   The first block (lines 2106–2110) describes the reload-pattern concept but 
is detached from any method — javac silently discards it and only attaches the 
second block (2111–2116) to `warnDataDirWithoutSourceDir()`. The first block 
belongs on `sourceDirReloadPattern()` (it describes that method's behaviour). 
Move it there, or merge the two blocks into one.



##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java:
##########
@@ -2096,6 +2103,46 @@ static void writeCamelMainRunLogConfig(Path target, 
String appName, String loggi
         }
     }
 
+    /**
+     * The reload pattern of dev mode with a source directory: every file 
under it, except the data folders
+     * (--data-dir), whose files the routes read and write: a change there is 
not a change of the sources, and reloading
+     * the routes for it restarts them, so they write again and reload again 
(CAMEL-25670).
+     */
+    /**
+     * --data-dir only changes what dev mode watches in a source directory: 
without one only the given files are
+     * watched, and their data folders are not, so the option has nothing to 
leave out. Said when it is given on the
+     * command line; camel.jbang.dataDir in an application.properties is not, 
as an example that declares its data
+     * folders also runs with its files (camel run --example).
+     */
+    private void warnDataDirWithoutSourceDir() {
+        if (dataDir != null && spec != null && spec.commandLine() != null
+                && spec.commandLine().getParseResult() != null
+                && 
spec.commandLine().getParseResult().hasMatchedOption("--data-dir")) {
+            printer().printErr("WARN: --data-dir is used with --source-dir: 
without a source directory dev mode only"

Review Comment:
   🐛 **Bug: inverted logic in warning text**
   
   This method is called when `sourceDir` is `null` (i.e. the user did **not** 
supply `--source-dir`), but the message says:
   
   > `--data-dir is used with --source-dir`
   
   That's the opposite of the truth. The message should read `--data-dir is 
used without --source-dir`.



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