This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.20.x by this push:
new b1355dc7cc1 CAMEL-18865: camel-main - Configuring options on beans dot
vs square style. Dot style should use getter/setter and square should use
map/list style first.
b1355dc7cc1 is described below
commit b1355dc7cc104947f3c0c468380edded410da1c0
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Jan 6 12:55:56 2023 +0100
CAMEL-18865: camel-main - Configuring options on beans dot vs square style.
Dot style should use getter/setter and square should use map/list style first.
---
.../src/main/java/org/apache/camel/main/MainHelper.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 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 4a874fb4328..35d1cf94a1b 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
@@ -508,7 +508,7 @@ public final class MainHelper {
public static OrderedLocationProperties extractProperties(
OrderedLocationProperties properties, String optionPrefix, String
optionSuffix,
- boolean remove, Function<String, String> onRemove) {
+ boolean remove, Function<String, String> keyTransformer) {
if (properties == null) {
return new OrderedLocationProperties();
}
@@ -520,14 +520,14 @@ public final class MainHelper {
String loc = properties.getLocation(key);
if (key.startsWith(optionPrefix)) {
Object value = properties.get(key);
- if (onRemove != null) {
- key = onRemove.apply(key);
+ if (keyTransformer != null) {
+ key = keyTransformer.apply(key);
} else {
key = key.substring(optionPrefix.length());
}
if (optionSuffix != null && key.endsWith(optionSuffix)) {
- if (onRemove != null) {
- key = onRemove.apply(key);
+ if (keyTransformer != null) {
+ key = keyTransformer.apply(key);
} else {
key = key.substring(0, key.length() -
optionSuffix.length());
}