From 5564f378e542a0ec379c28d44514b3b07402373c Mon Sep 17 00:00:00 2001 From: "pixeebot[bot]" <104101892+pixeebot[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 06:52:52 +0100 Subject: [PATCH] (Sonar) Fix "`String#replace` should be preferred to `String#replaceAll`" (#1056) Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com> --- src/main/java/stirling/software/SPDF/utils/GeneralUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/stirling/software/SPDF/utils/GeneralUtils.java b/src/main/java/stirling/software/SPDF/utils/GeneralUtils.java index 18e890c4..1d7f7b01 100644 --- a/src/main/java/stirling/software/SPDF/utils/GeneralUtils.java +++ b/src/main/java/stirling/software/SPDF/utils/GeneralUtils.java @@ -185,7 +185,7 @@ public class GeneralUtils { // Insert multiplication between a number and 'n' (e.g., "4n" becomes "4*n") String withMultiplication = expression.replaceAll("(\\d)n", "$1*n"); // Now replace 'n' with its current value - return withMultiplication.replaceAll("n", String.valueOf(nValue)); + return withMultiplication.replace("n", String.valueOf(nValue)); } private static List handlePart(String part, int totalPages, int offset) {