You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/02/07 07:10:50 UTC
[camel] branch master updated: CAMEL-16160: camel-main - JVM system
properties should override application.properties
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 690d64b CAMEL-16160: camel-main - JVM system properties should override application.properties
690d64b is described below
commit 690d64b19d813ee429857557f28c82f8d755d402
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Feb 7 08:10:19 2021 +0100
CAMEL-16160: camel-main - JVM system properties should override application.properties
---
.../src/main/java/org/apache/camel/main/MainHelper.java | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/core/camel-main/src/main/java/org/apache/camel/main/MainHelper.java b/core/camel-main/src/main/java/org/apache/camel/main/MainHelper.java
index 8412e8d..383a074 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/MainHelper.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/MainHelper.java
@@ -86,15 +86,10 @@ public final class MainHelper {
for (String prefix : prefixes) {
final String pk = prefix.toUpperCase(Locale.US).replaceAll("[^\\w]", "-");
final String pk2 = pk.replace('-', '.');
- Map<String, String> env = System.getenv();
System.getProperties().forEach((k, v) -> {
String key = k.toString().toUpperCase(Locale.US);
- if (!env.containsKey(key)) {
- // skip keys that are already from ENV so we don't process it twice
- // as we only want to do this for JVM system properties
- if (key.startsWith(pk) || key.startsWith(pk2)) {
- answer.put(k.toString(), v);
- }
+ if (key.startsWith(pk) || key.startsWith(pk2)) {
+ answer.put(k.toString(), v);
}
});
}