From 5cf303e9e19676244228eb90187857646bac618f Mon Sep 17 00:00:00 2001 From: Tomas Langer Date: Thu, 31 Oct 2024 14:04:44 +0100 Subject: [PATCH] Use replace instead of replaceAll for string replacement (regexp not needed) (#9448) Signed-off-by: Tomas Langer --- .../config/src/main/java/io/helidon/common/config/Config.java | 4 ++-- config/config/src/main/java/io/helidon/config/Config.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/config/src/main/java/io/helidon/common/config/Config.java b/common/config/src/main/java/io/helidon/common/config/Config.java index 5089bcf0368..b377beddaaf 100644 --- a/common/config/src/main/java/io/helidon/common/config/Config.java +++ b/common/config/src/main/java/io/helidon/common/config/Config.java @@ -383,8 +383,8 @@ static String escapeName(String name) { * @return unescaped name */ static String unescapeName(String escapedName) { - return escapedName.replaceAll("~1", ".") - .replaceAll("~0", "~"); + return escapedName.replace("~1", ".") + .replace("~0", "~"); } /** diff --git a/config/config/src/main/java/io/helidon/config/Config.java b/config/config/src/main/java/io/helidon/config/Config.java index f34c4a88d38..86d042fd401 100644 --- a/config/config/src/main/java/io/helidon/config/Config.java +++ b/config/config/src/main/java/io/helidon/config/Config.java @@ -1020,8 +1020,8 @@ static String escapeName(String name) { * @return unescaped name */ static String unescapeName(String escapedName) { - return escapedName.replaceAll("~1", ".") - .replaceAll("~0", "~"); + return escapedName.replace("~1", ".") + .replace("~0", "~"); } }