remove unnecessary try/catch

This commit is contained in:
Michael Hoennig 2024-03-23 11:46:08 +01:00
parent b75e0c9dd6
commit 78ecf98913

View File

@ -109,17 +109,13 @@ public class StringWriter {
} }
String apply(final String textToAppend) { String apply(final String textToAppend) {
try { text = textToAppend;
text = textToAppend; stream(varDefs).forEach(varDef -> {
stream(varDefs).forEach(varDef -> { final var pattern = Pattern.compile("\\$\\{" + varDef.name() + "}", Pattern.CASE_INSENSITIVE);
final var pattern = Pattern.compile("\\$\\{" + varDef.name() + "}", Pattern.CASE_INSENSITIVE); final var matcher = pattern.matcher(text);
final var matcher = pattern.matcher(text); text = matcher.replaceAll(varDef.value());
text = matcher.replaceAll(varDef.value()); });
}); return text;
return text;
} catch (final RuntimeException exc) {
throw exc; // FIXME: just for debugging, remove try/catch before merging to master
}
}
} }
}
} }