davsclaus commented on code in PR #24541:
URL: https://github.com/apache/camel/pull/24541#discussion_r3548699947


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportCamelMain.java:
##########
@@ -287,13 +287,13 @@ protected Set<String> resolveDependencies(Path settings, 
Path profile) throws Ex
             Properties prop = new CamelCaseOrderedProperties();
             RuntimeUtil.loadProperties(prop, profile);
             // if metrics is defined then include camel-micrometer-prometheus 
for camel-main runtime
-            if (prop.getProperty("camel.metrics.enabled") != null
-                    || prop.getProperty("camel.management.metricsEnabled") != 
null
-                    || prop.getProperty("camel.server.metricsEnabled") != 
null) {
+            if (prop.containsKey("camel.metrics.enabled")

Review Comment:
   `CamelCaseOrderedProperties` documents that the **get** methods support both 
camelCase and dash-style key lookup (its `getProperty()` tries the key as-is, 
then `dashToCamelCase`, then `camelCaseToDash`). The new `containsKey()` in 
`BaseOrderedProperties` only checks the exact key — no fallback.
   
   So if a user's profile has `camel.management.metrics-enabled=true` 
(dash-case), the old `getProperty("camel.management.metricsEnabled") != null` 
found it via the fallback, but `containsKey("camel.management.metricsEnabled")` 
won't.
   
   Either revert these lines back to `getProperty(...) != null`, or also 
override `containsKey()` in `CamelCaseOrderedProperties` with the same 
camelCase/dash fallback logic.



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