From cb6b491bfffe75abee87a8b3bc003e40a55efd57 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Sat, 23 Mar 2024 13:59:43 +0100 Subject: [PATCH] remove unnecessary try/catch --- .../hsadminng/rbac/rbacdef/StringWriter.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/main/java/net/hostsharing/hsadminng/rbac/rbacdef/StringWriter.java b/src/main/java/net/hostsharing/hsadminng/rbac/rbacdef/StringWriter.java index 5a5e0699..0376236c 100644 --- a/src/main/java/net/hostsharing/hsadminng/rbac/rbacdef/StringWriter.java +++ b/src/main/java/net/hostsharing/hsadminng/rbac/rbacdef/StringWriter.java @@ -109,17 +109,13 @@ public class StringWriter { } String apply(final String textToAppend) { - try { - text = textToAppend; - stream(varDefs).forEach(varDef -> { - final var pattern = Pattern.compile("\\$\\{" + varDef.name() + "}", Pattern.CASE_INSENSITIVE); - final var matcher = pattern.matcher(text); - text = matcher.replaceAll(varDef.value()); - }); - return text; - } catch (final RuntimeException exc) { - throw exc; // FIXME: just for debugging, remove try/catch before merging to master - } - } + text = textToAppend; + stream(varDefs).forEach(varDef -> { + final var pattern = Pattern.compile("\\$\\{" + varDef.name() + "}", Pattern.CASE_INSENSITIVE); + final var matcher = pattern.matcher(text); + text = matcher.replaceAll(varDef.value()); + }); + return text; } + } }