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

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

commit 632e5ece55a0d207afcacec851f6904a0bcbb8de
Author: Aurélien Pupier <apup...@redhat.com>
AuthorDate: Mon Jun 17 15:40:24 2024 +0200

    CAMEL-20884 - Replace this call to "replaceAll()" by a call to the
    "replace()"
    method.
    
    The underlying implementation of String::replaceAll calls the
    java.util.regex.Pattern.compile() method each time it is called even if
    the first argument is not a regular expression. This has a significant
    performance cost and therefore should be used with care.
    
    Signed-off-by: Aurélien Pupier <apup...@redhat.com>
---
 .../org/apache/camel/maven/packaging/UpdateSensitizeHelper.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateSensitizeHelper.java
 
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateSensitizeHelper.java
index 3f1ccda76d2..e388986414e 100644
--- 
a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateSensitizeHelper.java
+++ 
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateSensitizeHelper.java
@@ -109,7 +109,7 @@ public class UpdateSensitizeHelper extends 
AbstractGeneratorMojo {
                         if (o.isSecret()) {
                             // key should be lower and without dashes
                             String key = 
o.getName().toLowerCase(Locale.ENGLISH);
-                            key = key.replaceAll("-", "");
+                            key = key.replace("-", "");
                             secrets.add(key);
                         }
                     });
@@ -119,7 +119,7 @@ public class UpdateSensitizeHelper extends 
AbstractGeneratorMojo {
                         if (o.isSecret()) {
                             // key should be lower and without dashes
                             String key = 
o.getName().toLowerCase(Locale.ENGLISH);
-                            key = key.replaceAll("-", "");
+                            key = key.replace("-", "");
                             secrets.add(key);
                         }
                     });
@@ -129,7 +129,7 @@ public class UpdateSensitizeHelper extends 
AbstractGeneratorMojo {
                         if (o.isSecret()) {
                             // key should be lower and without dashes
                             String key = 
o.getName().toLowerCase(Locale.ENGLISH);
-                            key = key.replaceAll("-", "");
+                            key = key.replace("-", "");
                             secrets.add(key);
                         }
                     });

Reply via email to