This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 944694b8ace 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.
944694b8ace is described below

commit 944694b8acee06c85c5f41f50aad24713676613d
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());
                     }

Reply via email to